!function(d,l){"use strict";var e=!1,o=!1;if(l.querySelector)if(d.addEventListener)e=!0;if(d.wp=d.wp||{},!d.wp.receiveEmbedMessage)if(d.wp.receiveEmbedMessage=function(e){var t=e.data;if(t)if(t.secret||t.message||t.value)if(!/[^a-zA-Z0-9]/.test(t.secret)){var r,a,i,s,n,o=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),c=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]');for(r=0;r0?e=c.__plugins[d]:a.each(c.__plugins,function(a,b){return b.name.substring(b.name.length-d.length-1)=="."+d?(e=b,!1):void 0}),e}if(b.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");return c.__plugins[b.name]=b,b.core&&c.__bridge(b.core,c,b.name),this},_trigger:function(){var a=Array.prototype.slice.apply(arguments);return"string"==typeof a[0]&&(a[0]={type:a[0]}),this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,a),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,a),this},instances:function(b){var c=[],d=b||".tooltipstered";return a(d).each(function(){var b=a(this),d=b.data("tooltipster-ns");d&&a.each(d,function(a,d){c.push(b.data(d))})}),c},instancesLatest:function(){return this.__instancesLatestArr},off:function(){return this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},origins:function(b){var c=b?b+" ":"";return a(c+".tooltipstered").toArray()},setDefaults:function(b){return a.extend(f,b),this},triggerHandler:function(){return this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.tooltipster=new i,a.Tooltipster=function(b,c){this.__callbacks={close:[],open:[]},this.__closingTime,this.__Content,this.__contentBcr,this.__destroyed=!1,this.__$emitterPrivate=a({}),this.__$emitterPublic=a({}),this.__enabled=!0,this.__garbageCollector,this.__Geometry,this.__lastPosition,this.__namespace="tooltipster-"+Math.round(1e6*Math.random()),this.__options,this.__$originParents,this.__pointerIsOverOrigin=!1,this.__previousThemes=[],this.__state="closed",this.__timeouts={close:[],open:null},this.__touchEvents=[],this.__tracker=null,this._$origin,this._$tooltip,this.__init(b,c)},a.Tooltipster.prototype={__init:function(b,c){var d=this;if(d._$origin=a(b),d.__options=a.extend(!0,{},f,c),d.__optionsFormat(),!h.IE||h.IE>=d.__options.IEmin){var e=null;if(void 0===d._$origin.data("tooltipster-initialTitle")&&(e=d._$origin.attr("title"),void 0===e&&(e=null),d._$origin.data("tooltipster-initialTitle",e)),null!==d.__options.content)d.__contentSet(d.__options.content);else{var g,i=d._$origin.attr("data-tooltip-content");i&&(g=a(i)),g&&g[0]?d.__contentSet(g.first()):d.__contentSet(e)}d._$origin.removeAttr("title").addClass("tooltipstered"),d.__prepareOrigin(),d.__prepareGC(),a.each(d.__options.plugins,function(a,b){d._plug(b)}),h.hasTouchCapability&&a(h.window.document.body).on("touchmove."+d.__namespace+"-triggerOpen",function(a){d._touchRecordEvent(a)}),d._on("created",function(){d.__prepareTooltip()})._on("repositioned",function(a){d.__lastPosition=a.position})}else d.__options.disabled=!0},__contentInsert:function(){var a=this,b=a._$tooltip.find(".tooltipster-content"),c=a.__Content,d=function(a){c=a};return a._trigger({type:"format",content:a.__Content,format:d}),a.__options.functionFormat&&(c=a.__options.functionFormat.call(a,a,{origin:a._$origin[0]},a.__Content)),"string"!=typeof c||a.__options.contentAsHTML?b.empty().append(c):b.text(c),a},__contentSet:function(b){return b instanceof a&&this.__options.contentCloning&&(b=b.clone(!0)),this.__Content=b,this._trigger({type:"updated",content:b}),this},__destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},__geometry:function(){var b=this,c=b._$origin,d=b._$origin.is("area");if(d){var e=b._$origin.parent().attr("name");c=a('img[usemap="#'+e+'"]')}var f=c[0].getBoundingClientRect(),g=a(h.window.document),i=a(h.window),j=c,k={available:{document:null,window:null},document:{size:{height:g.height(),width:g.width()}},window:{scroll:{left:h.window.scrollX||h.window.document.documentElement.scrollLeft,top:h.window.scrollY||h.window.document.documentElement.scrollTop},size:{height:i.height(),width:i.width()}},origin:{fixedLineage:!1,offset:{},size:{height:f.bottom-f.top,width:f.right-f.left},usemapImage:d?c[0]:null,windowOffset:{bottom:f.bottom,left:f.left,right:f.right,top:f.top}}};if(d){var l=b._$origin.attr("shape"),m=b._$origin.attr("coords");if(m&&(m=m.split(","),a.map(m,function(a,b){m[b]=parseInt(a)})),"default"!=l)switch(l){case"circle":var n=m[0],o=m[1],p=m[2],q=o-p,r=n-p;k.origin.size.height=2*p,k.origin.size.width=k.origin.size.height,k.origin.windowOffset.left+=r,k.origin.windowOffset.top+=q;break;case"rect":var s=m[0],t=m[1],u=m[2],v=m[3];k.origin.size.height=v-t,k.origin.size.width=u-s,k.origin.windowOffset.left+=s,k.origin.windowOffset.top+=t;break;case"poly":for(var w=0,x=0,y=0,z=0,A="even",B=0;By&&(y=C,0===B&&(w=y)),w>C&&(w=C),A="odd"):(C>z&&(z=C,1==B&&(x=z)),x>C&&(x=C),A="even")}k.origin.size.height=z-x,k.origin.size.width=y-w,k.origin.windowOffset.left+=w,k.origin.windowOffset.top+=x}}var D=function(a){k.origin.size.height=a.height,k.origin.windowOffset.left=a.left,k.origin.windowOffset.top=a.top,k.origin.size.width=a.width};for(b._trigger({type:"geometry",edit:D,geometry:{height:k.origin.size.height,left:k.origin.windowOffset.left,top:k.origin.windowOffset.top,width:k.origin.size.width}}),k.origin.windowOffset.right=k.origin.windowOffset.left+k.origin.size.width,k.origin.windowOffset.bottom=k.origin.windowOffset.top+k.origin.size.height,k.origin.offset.left=k.origin.windowOffset.left+k.window.scroll.left,k.origin.offset.top=k.origin.windowOffset.top+k.window.scroll.top,k.origin.offset.bottom=k.origin.offset.top+k.origin.size.height,k.origin.offset.right=k.origin.offset.left+k.origin.size.width,k.available.document={bottom:{height:k.document.size.height-k.origin.offset.bottom,width:k.document.size.width},left:{height:k.document.size.height,width:k.origin.offset.left},right:{height:k.document.size.height,width:k.document.size.width-k.origin.offset.right},top:{height:k.origin.offset.top,width:k.document.size.width}},k.available.window={bottom:{height:Math.max(k.window.size.height-Math.max(k.origin.windowOffset.bottom,0),0),width:k.window.size.width},left:{height:k.window.size.height,width:Math.max(k.origin.windowOffset.left,0)},right:{height:k.window.size.height,width:Math.max(k.window.size.width-Math.max(k.origin.windowOffset.right,0),0)},top:{height:Math.max(k.origin.windowOffset.top,0),width:k.window.size.width}};"html"!=j[0].tagName.toLowerCase();){if("fixed"==j.css("position")){k.origin.fixedLineage=!0;break}j=j.parent()}return k},__optionsFormat:function(){return"number"==typeof this.__options.animationDuration&&(this.__options.animationDuration=[this.__options.animationDuration,this.__options.animationDuration]),"number"==typeof this.__options.delay&&(this.__options.delay=[this.__options.delay,this.__options.delay]),"number"==typeof this.__options.delayTouch&&(this.__options.delayTouch=[this.__options.delayTouch,this.__options.delayTouch]),"string"==typeof this.__options.theme&&(this.__options.theme=[this.__options.theme]),null===this.__options.parent?this.__options.parent=a(h.window.document.body):"string"==typeof this.__options.parent&&(this.__options.parent=a(this.__options.parent)),"hover"==this.__options.trigger?(this.__options.triggerOpen={mouseenter:!0,touchstart:!0},this.__options.triggerClose={mouseleave:!0,originClick:!0,touchleave:!0}):"click"==this.__options.trigger&&(this.__options.triggerOpen={click:!0,tap:!0},this.__options.triggerClose={click:!0,tap:!0}),this._trigger("options"),this},__prepareGC:function(){var b=this;return b.__options.selfDestruction?b.__garbageCollector=setInterval(function(){var c=(new Date).getTime();b.__touchEvents=a.grep(b.__touchEvents,function(a,b){return c-a.time>6e4}),d(b._$origin)||b.close(function(){b.destroy()})},2e4):clearInterval(b.__garbageCollector),b},__prepareOrigin:function(){var a=this;if(a._$origin.off("."+a.__namespace+"-triggerOpen"),h.hasTouchCapability&&a._$origin.on("touchstart."+a.__namespace+"-triggerOpen touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen",function(b){a._touchRecordEvent(b)}),a.__options.triggerOpen.click||a.__options.triggerOpen.tap&&h.hasTouchCapability){var b="";a.__options.triggerOpen.click&&(b+="click."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.tap&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&a._open(b)})}if(a.__options.triggerOpen.mouseenter||a.__options.triggerOpen.touchstart&&h.hasTouchCapability){var b="";a.__options.triggerOpen.mouseenter&&(b+="mouseenter."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.touchstart&&h.hasTouchCapability&&(b+="touchstart."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){!a._touchIsTouchEvent(b)&&a._touchIsEmulatedEvent(b)||(a.__pointerIsOverOrigin=!0,a._openShortly(b))})}if(a.__options.triggerClose.mouseleave||a.__options.triggerClose.touchleave&&h.hasTouchCapability){var b="";a.__options.triggerClose.mouseleave&&(b+="mouseleave."+a.__namespace+"-triggerOpen "),a.__options.triggerClose.touchleave&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&(a.__pointerIsOverOrigin=!1)})}return a},__prepareTooltip:function(){var b=this,c=b.__options.interactive?"auto":"";return b._$tooltip.attr("id",b.__namespace).css({"pointer-events":c,zIndex:b.__options.zIndex}),a.each(b.__previousThemes,function(a,c){b._$tooltip.removeClass(c)}),a.each(b.__options.theme,function(a,c){b._$tooltip.addClass(c)}),b.__previousThemes=a.merge([],b.__options.theme),b},__scrollHandler:function(b){var c=this;if(c.__options.triggerClose.scroll)c._close(b);else if(d(c._$origin)&&d(c._$tooltip)){var e=null;if(b.target===h.window.document)c.__Geometry.origin.fixedLineage||c.__options.repositionOnScroll&&c.reposition(b);else{e=c.__geometry();var f=!1;if("fixed"!=c._$origin.css("position")&&c.__$originParents.each(function(b,c){var d=a(c),g=d.css("overflow-x"),h=d.css("overflow-y");if("visible"!=g||"visible"!=h){var i=c.getBoundingClientRect();if("visible"!=g&&(e.origin.windowOffset.lefti.right))return f=!0,!1;if("visible"!=h&&(e.origin.windowOffset.topi.bottom))return f=!0,!1}return"fixed"==d.css("position")?!1:void 0}),f)c._$tooltip.css("visibility","hidden");else if(c._$tooltip.css("visibility","visible"),c.__options.repositionOnScroll)c.reposition(b);else{var g=e.origin.offset.left-c.__Geometry.origin.offset.left,i=e.origin.offset.top-c.__Geometry.origin.offset.top;c._$tooltip.css({left:c.__lastPosition.coord.left+g,top:c.__lastPosition.coord.top+i})}}c._trigger({type:"scroll",event:b,geo:e})}return c},__stateSet:function(a){return this.__state=a,this._trigger({type:"state",state:a}),this},__timeoutsClear:function(){return clearTimeout(this.__timeouts.open),this.__timeouts.open=null,a.each(this.__timeouts.close,function(a,b){clearTimeout(b)}),this.__timeouts.close=[],this},__trackerStart:function(){var a=this,b=a._$tooltip.find(".tooltipster-content");return a.__options.trackTooltip&&(a.__contentBcr=b[0].getBoundingClientRect()),a.__tracker=setInterval(function(){if(d(a._$origin)&&d(a._$tooltip)){if(a.__options.trackOrigin){var e=a.__geometry(),f=!1;c(e.origin.size,a.__Geometry.origin.size)&&(a.__Geometry.origin.fixedLineage?c(e.origin.windowOffset,a.__Geometry.origin.windowOffset)&&(f=!0):c(e.origin.offset,a.__Geometry.origin.offset)&&(f=!0)),f||(a.__options.triggerClose.mouseleave?a._close():a.reposition())}if(a.__options.trackTooltip){var g=b[0].getBoundingClientRect();g.height===a.__contentBcr.height&&g.width===a.__contentBcr.width||(a.reposition(),a.__contentBcr=g)}}else a._close()},a.__options.trackerInterval),a},_close:function(b,c,d){var e=this,f=!0;if(e._trigger({type:"close",event:b,stop:function(){f=!1}}),f||d){c&&e.__callbacks.close.push(c),e.__callbacks.open=[],e.__timeoutsClear();var g=function(){a.each(e.__callbacks.close,function(a,c){c.call(e,e,{event:b,origin:e._$origin[0]})}),e.__callbacks.close=[]};if("closed"!=e.__state){var i=!0,j=new Date,k=j.getTime(),l=k+e.__options.animationDuration[1];if("disappearing"==e.__state&&l>e.__closingTime&&e.__options.animationDuration[1]>0&&(i=!1),i){e.__closingTime=l,"disappearing"!=e.__state&&e.__stateSet("disappearing");var m=function(){clearInterval(e.__tracker),e._trigger({type:"closing",event:b}),e._$tooltip.off("."+e.__namespace+"-triggerClose").removeClass("tooltipster-dying"),a(h.window).off("."+e.__namespace+"-triggerClose"),e.__$originParents.each(function(b,c){a(c).off("scroll."+e.__namespace+"-triggerClose")}),e.__$originParents=null,a(h.window.document.body).off("."+e.__namespace+"-triggerClose"),e._$origin.off("."+e.__namespace+"-triggerClose"),e._off("dismissable"),e.__stateSet("closed"),e._trigger({type:"after",event:b}),e.__options.functionAfter&&e.__options.functionAfter.call(e,e,{event:b,origin:e._$origin[0]}),g()};h.hasTransitions?(e._$tooltip.css({"-moz-animation-duration":e.__options.animationDuration[1]+"ms","-ms-animation-duration":e.__options.animationDuration[1]+"ms","-o-animation-duration":e.__options.animationDuration[1]+"ms","-webkit-animation-duration":e.__options.animationDuration[1]+"ms","animation-duration":e.__options.animationDuration[1]+"ms","transition-duration":e.__options.animationDuration[1]+"ms"}),e._$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),e.__options.animationDuration[1]>0&&e._$tooltip.delay(e.__options.animationDuration[1]),e._$tooltip.queue(m)):e._$tooltip.stop().fadeOut(e.__options.animationDuration[1],m)}}else g()}return e},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_open:function(b,c){var e=this;if(!e.__destroying&&d(e._$origin)&&e.__enabled){var f=!0;if("closed"==e.__state&&(e._trigger({type:"before",event:b,stop:function(){f=!1}}),f&&e.__options.functionBefore&&(f=e.__options.functionBefore.call(e,e,{event:b,origin:e._$origin[0]}))),f!==!1&&null!==e.__Content){c&&e.__callbacks.open.push(c),e.__callbacks.close=[],e.__timeoutsClear();var g,i=function(){"stable"!=e.__state&&e.__stateSet("stable"),a.each(e.__callbacks.open,function(a,b){b.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}),e.__callbacks.open=[]};if("closed"!==e.__state)g=0,"disappearing"===e.__state?(e.__stateSet("appearing"),h.hasTransitions?(e._$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i)):e._$tooltip.stop().fadeIn(i)):"stable"==e.__state&&i();else{if(e.__stateSet("appearing"),g=e.__options.animationDuration[0],e.__contentInsert(),e.reposition(b,!0),h.hasTransitions?(e._$tooltip.addClass("tooltipster-"+e.__options.animation).addClass("tooltipster-initial").css({"-moz-animation-duration":e.__options.animationDuration[0]+"ms","-ms-animation-duration":e.__options.animationDuration[0]+"ms","-o-animation-duration":e.__options.animationDuration[0]+"ms","-webkit-animation-duration":e.__options.animationDuration[0]+"ms","animation-duration":e.__options.animationDuration[0]+"ms","transition-duration":e.__options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=e.__state&&(e._$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i))},0)):e._$tooltip.css("display","none").fadeIn(e.__options.animationDuration[0],i),e.__trackerStart(),a(h.window).on("resize."+e.__namespace+"-triggerClose",function(b){var c=a(document.activeElement);(c.is("input")||c.is("textarea"))&&a.contains(e._$tooltip[0],c[0])||e.reposition(b)}).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)}),e.__$originParents=e._$origin.parents(),e.__$originParents.each(function(b,c){a(c).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)})}),e.__options.triggerClose.mouseleave||e.__options.triggerClose.touchleave&&h.hasTouchCapability){e._on("dismissable",function(a){a.dismissable?a.delay?(m=setTimeout(function(){e._close(a.event)},a.delay),e.__timeouts.close.push(m)):e._close(a):clearTimeout(m)});var j=e._$origin,k="",l="",m=null;e.__options.interactive&&(j=j.add(e._$tooltip)),e.__options.triggerClose.mouseleave&&(k+="mouseenter."+e.__namespace+"-triggerClose ",l+="mouseleave."+e.__namespace+"-triggerClose "),e.__options.triggerClose.touchleave&&h.hasTouchCapability&&(k+="touchstart."+e.__namespace+"-triggerClose",l+="touchend."+e.__namespace+"-triggerClose touchcancel."+e.__namespace+"-triggerClose"),j.on(l,function(a){if(e._touchIsTouchEvent(a)||!e._touchIsEmulatedEvent(a)){var b="mouseleave"==a.type?e.__options.delay:e.__options.delayTouch;e._trigger({delay:b[1],dismissable:!0,event:a,type:"dismissable"})}}).on(k,function(a){!e._touchIsTouchEvent(a)&&e._touchIsEmulatedEvent(a)||e._trigger({dismissable:!1,event:a,type:"dismissable"})})}e.__options.triggerClose.originClick&&e._$origin.on("click."+e.__namespace+"-triggerClose",function(a){e._touchIsTouchEvent(a)||e._touchIsEmulatedEvent(a)||e._close(a)}),(e.__options.triggerClose.click||e.__options.triggerClose.tap&&h.hasTouchCapability)&&setTimeout(function(){if("closed"!=e.__state){var b="",c=a(h.window.document.body);e.__options.triggerClose.click&&(b+="click."+e.__namespace+"-triggerClose "),e.__options.triggerClose.tap&&h.hasTouchCapability&&(b+="touchend."+e.__namespace+"-triggerClose"),c.on(b,function(b){e._touchIsMeaningfulEvent(b)&&(e._touchRecordEvent(b),e.__options.interactive&&a.contains(e._$tooltip[0],b.target)||e._close(b))}),e.__options.triggerClose.tap&&h.hasTouchCapability&&c.on("touchstart."+e.__namespace+"-triggerClose",function(a){e._touchRecordEvent(a)})}},0),e._trigger("ready"),e.__options.functionReady&&e.__options.functionReady.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}if(e.__options.timer>0){var m=setTimeout(function(){e._close()},e.__options.timer+g);e.__timeouts.close.push(m)}}}return e},_openShortly:function(a){var b=this,c=!0;if("stable"!=b.__state&&"appearing"!=b.__state&&!b.__timeouts.open&&(b._trigger({type:"start",event:a,stop:function(){c=!1}}),c)){var d=0==a.type.indexOf("touch")?b.__options.delayTouch:b.__options.delay;d[0]?b.__timeouts.open=setTimeout(function(){b.__timeouts.open=null,b.__pointerIsOverOrigin&&b._touchIsMeaningfulEvent(a)?(b._trigger("startend"),b._open(a)):b._trigger("startcancel")},d[0]):(b._trigger("startend"),b._open(a))}return b},_optionsExtract:function(b,c){var d=this,e=a.extend(!0,{},c),f=d.__options[b];return f||(f={},a.each(c,function(a,b){var c=d.__options[a];void 0!==c&&(f[a]=c)})),a.each(e,function(b,c){void 0!==f[b]&&("object"!=typeof c||c instanceof Array||null==c||"object"!=typeof f[b]||f[b]instanceof Array||null==f[b]?e[b]=f[b]:a.extend(e[b],f[b]))}),e},_plug:function(b){var c=a.tooltipster._plugin(b);if(!c)throw new Error('The "'+b+'" plugin is not defined');return c.instance&&a.tooltipster.__bridge(c.instance,this,c.name),this},_touchIsEmulatedEvent:function(a){for(var b=!1,c=(new Date).getTime(),d=this.__touchEvents.length-1;d>=0;d--){var e=this.__touchEvents[d];if(!(c-e.time<500))break;e.target===a.target&&(b=!0)}return b},_touchIsMeaningfulEvent:function(a){return this._touchIsTouchEvent(a)&&!this._touchSwiped(a.target)||!this._touchIsTouchEvent(a)&&!this._touchIsEmulatedEvent(a)},_touchIsTouchEvent:function(a){return 0==a.type.indexOf("touch")},_touchRecordEvent:function(a){return this._touchIsTouchEvent(a)&&(a.time=(new Date).getTime(),this.__touchEvents.push(a)),this},_touchSwiped:function(a){for(var b=!1,c=this.__touchEvents.length-1;c>=0;c--){var d=this.__touchEvents[c];if("touchmove"==d.type){b=!0;break}if("touchstart"==d.type&&a===d.target)break}return b},_trigger:function(){var b=Array.prototype.slice.apply(arguments);return"string"==typeof b[0]&&(b[0]={type:b[0]}),b[0].instance=this,b[0].origin=this._$origin?this._$origin[0]:null,b[0].tooltip=this._$tooltip?this._$tooltip[0]:null,this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,b),a.tooltipster._trigger.apply(a.tooltipster,b),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,b),this},_unplug:function(b){var c=this;if(c[b]){var d=a.tooltipster._plugin(b);d.instance&&a.each(d.instance,function(a,d){c[a]&&c[a].bridged===c[b]&&delete c[a]}),c[b].__destroy&&c[b].__destroy(),delete c[b]}return c},close:function(a){return this.__destroyed?this.__destroyError():this._close(null,a),this},content:function(a){var b=this;if(void 0===a)return b.__Content;if(b.__destroyed)b.__destroyError();else if(b.__contentSet(a),null!==b.__Content){if("closed"!==b.__state&&(b.__contentInsert(),b.reposition(),b.__options.updateAnimation))if(h.hasTransitions){var c=b.__options.updateAnimation;b._$tooltip.addClass("tooltipster-update-"+c),setTimeout(function(){"closed"!=b.__state&&b._$tooltip.removeClass("tooltipster-update-"+c)},1e3)}else b._$tooltip.fadeTo(200,.5,function(){"closed"!=b.__state&&b._$tooltip.fadeTo(200,1)})}else b._close();return b},destroy:function(){var b=this;if(b.__destroyed)b.__destroyError();else{"closed"!=b.__state?b.option("animationDuration",0)._close(null,null,!0):b.__timeoutsClear(),b._trigger("destroy"),b.__destroyed=!0,b._$origin.removeData(b.__namespace).off("."+b.__namespace+"-triggerOpen"),a(h.window.document.body).off("."+b.__namespace+"-triggerOpen");var c=b._$origin.data("tooltipster-ns");if(c)if(1===c.length){var d=null;"previous"==b.__options.restoration?d=b._$origin.data("tooltipster-initialTitle"):"current"==b.__options.restoration&&(d="string"==typeof b.__Content?b.__Content:a("
").append(b.__Content).html()),d&&b._$origin.attr("title",d),b._$origin.removeClass("tooltipstered"),b._$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else c=a.grep(c,function(a,c){return a!==b.__namespace}),b._$origin.data("tooltipster-ns",c);b._trigger("destroyed"),b._off(),b.off(),b.__Content=null,b.__$emitterPrivate=null,b.__$emitterPublic=null,b.__options.parent=null,b._$origin=null,b._$tooltip=null,a.tooltipster.__instancesLatestArr=a.grep(a.tooltipster.__instancesLatestArr,function(a,c){return b!==a}),clearInterval(b.__garbageCollector)}return b},disable:function(){return this.__destroyed?(this.__destroyError(),this):(this._close(),this.__enabled=!1,this)},elementOrigin:function(){return this.__destroyed?void this.__destroyError():this._$origin[0]},elementTooltip:function(){return this._$tooltip?this._$tooltip[0]:null},enable:function(){return this.__enabled=!0,this},hide:function(a){return this.close(a)},instance:function(){return this},off:function(){return this.__destroyed||this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(a){return this.__destroyed?this.__destroyError():this._open(null,a),this},option:function(b,c){return void 0===c?this.__options[b]:(this.__destroyed?this.__destroyError():(this.__options[b]=c,this.__optionsFormat(),a.inArray(b,["trigger","triggerClose","triggerOpen"])>=0&&this.__prepareOrigin(),"selfDestruction"===b&&this.__prepareGC()),this)},reposition:function(a,b){var c=this;return c.__destroyed?c.__destroyError():"closed"!=c.__state&&d(c._$origin)&&(b||d(c._$tooltip))&&(b||c._$tooltip.detach(),c.__Geometry=c.__geometry(),c._trigger({type:"reposition",event:a,helper:{geo:c.__Geometry}})),c},show:function(a){return this.open(a)},status:function(){return{destroyed:this.__destroyed,enabled:this.__enabled,open:"closed"!==this.__state,state:this.__state}},triggerHandler:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.fn.tooltipster=function(){var b=Array.prototype.slice.apply(arguments),c="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";if(0===this.length)return this;if("string"==typeof b[0]){var d="#*$~&";return this.each(function(){var e=a(this).data("tooltipster-ns"),f=e?a(this).data(e[0]):null;if(!f)throw new Error("You called Tooltipster's \""+b[0]+'" method on an uninitialized element');if("function"!=typeof f[b[0]])throw new Error('Unknown method "'+b[0]+'"');this.length>1&&"content"==b[0]&&(b[1]instanceof a||"object"==typeof b[1]&&null!=b[1]&&b[1].tagName)&&!f.__options.contentCloning&&f.__options.debug&&console.log(c);var g=f[b[0]](b[1],b[2]);return g!==f||"instance"===b[0]?(d=g,!1):void 0}),"#*$~&"!==d?d:this}a.tooltipster.__instancesLatestArr=[];var e=b[0]&&void 0!==b[0].multiple,g=e&&b[0].multiple||!e&&f.multiple,h=b[0]&&void 0!==b[0].content,i=h&&b[0].content||!h&&f.content,j=b[0]&&void 0!==b[0].contentCloning,k=j&&b[0].contentCloning||!j&&f.contentCloning,l=b[0]&&void 0!==b[0].debug,m=l&&b[0].debug||!l&&f.debug;return this.length>1&&(i instanceof a||"object"==typeof i&&null!=i&&i.tagName)&&!k&&m&&console.log(c),this.each(function(){var c=!1,d=a(this),e=d.data("tooltipster-ns"),f=null;e?g?c=!0:m&&false:c=!0,c&&(f=new a.Tooltipster(this,b[0]),e||(e=[]),e.push(f.__namespace),d.data("tooltipster-ns",e),d.data(f.__namespace,f),f.__options.functionInit&&f.__options.functionInit.call(f,f,{origin:this}),f._trigger("init")),a.tooltipster.__instancesLatestArr.push(f)}),this},b.prototype={__init:function(b){this.__$tooltip=b,this.__$tooltip.css({left:0,overflow:"hidden",position:"absolute",top:0}).find(".tooltipster-content").css("overflow","auto"),this.$container=a('
').append(this.__$tooltip).appendTo(h.window.document.body)},__forceRedraw:function(){var a=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(a)},constrain:function(a,b){return this.constraints={width:a,height:b},this.__$tooltip.css({display:"block",height:"",overflow:"auto",width:a}),this},destroy:function(){this.__$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.__$tooltip.css({display:"",height:"",overflow:"visible",width:""}),this},measure:function(){this.__forceRedraw();var a=this.__$tooltip[0].getBoundingClientRect(),b={size:{height:a.height||a.bottom-a.top,width:a.width||a.right-a.left}};if(this.constraints){var c=this.__$tooltip.find(".tooltipster-content"),d=this.__$tooltip.outerHeight(),e=c[0].getBoundingClientRect(),f={height:d<=this.constraints.height,width:a.width<=this.constraints.width&&e.width>=c[0].scrollWidth-1};b.fits=f.height&&f.width}return h.IE&&h.IE<=11&&b.size.width!==h.window.document.documentElement.clientWidth&&(b.size.width=Math.ceil(b.size.width)+1),b}};var j=navigator.userAgent.toLowerCase();-1!=j.indexOf("msie")?h.IE=parseInt(j.split("msie")[1]):-1!==j.toLowerCase().indexOf("trident")&&-1!==j.indexOf(" rv:11")?h.IE=11:-1!=j.toLowerCase().indexOf("edge/")&&(h.IE=parseInt(j.toLowerCase().split("edge/")[1]));var k="tooltipster.sideTip";return a.tooltipster._plugin({name:k,instance:{__defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,position:null,side:"top",viewportAware:!0}},__init:function(a){var b=this;b.__instance=a,b.__namespace="tooltipster-sideTip-"+Math.round(1e6*Math.random()),b.__previousState="closed",b.__options,b.__optionsFormat(),b.__instance._on("state."+b.__namespace,function(a){"closed"==a.state?b.__close():"appearing"==a.state&&"closed"==b.__previousState&&b.__create(),b.__previousState=a.state}),b.__instance._on("options."+b.__namespace,function(){b.__optionsFormat()}),b.__instance._on("reposition."+b.__namespace,function(a){b.__reposition(a.event,a.helper)})},__close:function(){this.__instance.content()instanceof a&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var b=a('
');this.__options.arrow||b.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.__options.minWidth&&b.css("min-width",this.__options.minWidth+"px"),this.__options.maxWidth&&b.css("max-width",this.__options.maxWidth+"px"), this.__instance._$tooltip=b,this.__instance._trigger("created")},__destroy:function(){this.__instance._off("."+self.__namespace)},__optionsFormat:function(){var b=this;if(b.__options=b.__instance._optionsExtract(k,b.__defaults()),b.__options.position&&(b.__options.side=b.__options.position),"object"!=typeof b.__options.distance&&(b.__options.distance=[b.__options.distance]),b.__options.distance.length<4&&(void 0===b.__options.distance[1]&&(b.__options.distance[1]=b.__options.distance[0]),void 0===b.__options.distance[2]&&(b.__options.distance[2]=b.__options.distance[0]),void 0===b.__options.distance[3]&&(b.__options.distance[3]=b.__options.distance[1]),b.__options.distance={top:b.__options.distance[0],right:b.__options.distance[1],bottom:b.__options.distance[2],left:b.__options.distance[3]}),"string"==typeof b.__options.side){var c={top:"bottom",right:"left",bottom:"top",left:"right"};b.__options.side=[b.__options.side,c[b.__options.side]],"left"==b.__options.side[0]||"right"==b.__options.side[0]?b.__options.side.push("top","bottom"):b.__options.side.push("right","left")}6===a.tooltipster._env.IE&&b.__options.arrow!==!0&&(b.__options.arrow=!1)},__reposition:function(b,c){var d,e=this,f=e.__targetFind(c),g=[];e.__instance._$tooltip.detach();var h=e.__instance._$tooltip.clone(),i=a.tooltipster._getRuler(h),j=!1,k=e.__instance.option("animation");switch(k&&h.removeClass("tooltipster-"+k),a.each(["window","document"],function(d,k){var l=null;if(e.__instance._trigger({container:k,helper:c,satisfied:j,takeTest:function(a){l=a},results:g,type:"positionTest"}),1==l||0!=l&&0==j&&("window"!=k||e.__options.viewportAware))for(var d=0;d=h.outerSize.width&&c.geo.available[k][n].height>=h.outerSize.height?h.fits=!0:h.fits=!1:h.fits=p.fits,"window"==k&&(h.fits?"top"==n||"bottom"==n?h.whole=c.geo.origin.windowOffset.right>=e.__options.minIntersection&&c.geo.window.size.width-c.geo.origin.windowOffset.left>=e.__options.minIntersection:h.whole=c.geo.origin.windowOffset.bottom>=e.__options.minIntersection&&c.geo.window.size.height-c.geo.origin.windowOffset.top>=e.__options.minIntersection:h.whole=!1),g.push(h),h.whole)j=!0;else if("natural"==h.mode&&(h.fits||h.size.width<=c.geo.available[k][n].width))return!1}})}}),e.__instance._trigger({edit:function(a){g=a},event:b,helper:c,results:g,type:"positionTested"}),g.sort(function(a,b){if(a.whole&&!b.whole)return-1;if(!a.whole&&b.whole)return 1;if(a.whole&&b.whole){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}if(a.fits&&!b.fits)return-1;if(!a.fits&&b.fits)return 1;if(a.fits&&b.fits){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}return"document"==a.container&&"bottom"==a.side&&"natural"==a.mode?-1:1}),d=g[0],d.coord={},d.side){case"left":case"right":d.coord.top=Math.floor(d.target-d.size.height/2);break;case"bottom":case"top":d.coord.left=Math.floor(d.target-d.size.width/2)}switch(d.side){case"left":d.coord.left=c.geo.origin.windowOffset.left-d.outerSize.width;break;case"right":d.coord.left=c.geo.origin.windowOffset.right+d.distance.horizontal;break;case"top":d.coord.top=c.geo.origin.windowOffset.top-d.outerSize.height;break;case"bottom":d.coord.top=c.geo.origin.windowOffset.bottom+d.distance.vertical}"window"==d.container?"top"==d.side||"bottom"==d.side?d.coord.left<0?c.geo.origin.windowOffset.right-this.__options.minIntersection>=0?d.coord.left=0:d.coord.left=c.geo.origin.windowOffset.right-this.__options.minIntersection-1:d.coord.left>c.geo.window.size.width-d.size.width&&(c.geo.origin.windowOffset.left+this.__options.minIntersection<=c.geo.window.size.width?d.coord.left=c.geo.window.size.width-d.size.width:d.coord.left=c.geo.origin.windowOffset.left+this.__options.minIntersection+1-d.size.width):d.coord.top<0?c.geo.origin.windowOffset.bottom-this.__options.minIntersection>=0?d.coord.top=0:d.coord.top=c.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:d.coord.top>c.geo.window.size.height-d.size.height&&(c.geo.origin.windowOffset.top+this.__options.minIntersection<=c.geo.window.size.height?d.coord.top=c.geo.window.size.height-d.size.height:d.coord.top=c.geo.origin.windowOffset.top+this.__options.minIntersection+1-d.size.height):(d.coord.left>c.geo.window.size.width-d.size.width&&(d.coord.left=c.geo.window.size.width-d.size.width),d.coord.left<0&&(d.coord.left=0)),e.__sideChange(h,d.side),c.tooltipClone=h[0],c.tooltipParent=e.__instance.option("parent").parent[0],c.mode=d.mode,c.whole=d.whole,c.origin=e.__instance._$origin[0],c.tooltip=e.__instance._$tooltip[0],delete d.container,delete d.fits,delete d.mode,delete d.outerSize,delete d.whole,d.distance=d.distance.horizontal||d.distance.vertical;var l=a.extend(!0,{},d);if(e.__instance._trigger({edit:function(a){d=a},event:b,helper:c,position:l,type:"position"}),e.__options.functionPosition){var m=e.__options.functionPosition.call(e,e.__instance,c,l);m&&(d=m)}i.destroy();var n,o;"top"==d.side||"bottom"==d.side?(n={prop:"left",val:d.target-d.coord.left},o=d.size.width-this.__options.minIntersection):(n={prop:"top",val:d.target-d.coord.top},o=d.size.height-this.__options.minIntersection),n.valo&&(n.val=o);var p;p=c.geo.origin.fixedLineage?c.geo.origin.windowOffset:{left:c.geo.origin.windowOffset.left+c.geo.window.scroll.left,top:c.geo.origin.windowOffset.top+c.geo.window.scroll.top},d.coord={left:p.left+(d.coord.left-c.geo.origin.windowOffset.left),top:p.top+(d.coord.top-c.geo.origin.windowOffset.top)},e.__sideChange(e.__instance._$tooltip,d.side),c.geo.origin.fixedLineage?e.__instance._$tooltip.css("position","fixed"):e.__instance._$tooltip.css("position",""),e.__instance._$tooltip.css({left:d.coord.left,top:d.coord.top,height:d.size.height,width:d.size.width}).find(".tooltipster-arrow").css({left:"",top:""}).css(n.prop,n.val),e.__instance._$tooltip.appendTo(e.__instance.option("parent")),e.__instance._trigger({type:"repositioned",event:b,position:d})},__sideChange:function(a,b){a.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+b)},__targetFind:function(a){var b={},c=this.__instance._$origin[0].getClientRects();if(c.length>1){var d=this.__instance._$origin.css("opacity");1==d&&(this.__instance._$origin.css("opacity",.99),c=this.__instance._$origin[0].getClientRects(),this.__instance._$origin.css("opacity",1))}if(c.length<2)b.top=Math.floor(a.geo.origin.windowOffset.left+a.geo.origin.size.width/2),b.bottom=b.top,b.left=Math.floor(a.geo.origin.windowOffset.top+a.geo.origin.size.height/2),b.right=b.left;else{var e=c[0];b.top=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil(c.length/2)-1]:c[0],b.right=Math.floor(e.top+(e.bottom-e.top)/2),e=c[c.length-1],b.bottom=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil((c.length+1)/2)-1]:c[c.length-1],b.left=Math.floor(e.top+(e.bottom-e.top)/2)}return b}}}),a}); (function(f){function A(a,b,d){var c=a[0],g=/er/.test(d)?_indeterminate:/bl/.test(d)?n:k,e=d==_update?{checked:c[k],disabled:c[n],indeterminate:"true"==a.attr(_indeterminate)||"false"==a.attr(_determinate)}:c[g];if(/^(ch|di|in)/.test(d)&&!e)x(a,g);else if(/^(un|en|de)/.test(d)&&e)q(a,g);else if(d==_update)for(var f in e)e[f]?x(a,f,!0):q(a,f,!0);else if(!b||"toggle"==d){if(!b)a[_callback]("ifClicked");e?c[_type]!==r&&q(a,g):x(a,g)}}function x(a,b,d){var c=a[0],g=a.parent(),e=b==k,u=b==_indeterminate, v=b==n,s=u?_determinate:e?y:"enabled",F=l(a,s+t(c[_type])),B=l(a,b+t(c[_type]));if(!0!==c[b]){if(!d&&b==k&&c[_type]==r&&c.name){var w=a.closest("form"),p='input[name="'+c.name+'"]',p=w.length?w.find(p):f(p);p.each(function(){this!==c&&f(this).data(m)&&q(f(this),b)})}u?(c[b]=!0,c[k]&&q(a,k,"force")):(d||(c[b]=!0),e&&c[_indeterminate]&&q(a,_indeterminate,!1));D(a,e,b,d)}c[n]&&l(a,_cursor,!0)&&g.find("."+C).css(_cursor,"default");g[_add](B||l(a,b)||"");g.attr("role")&&!u&&g.attr("aria-"+(v?n:k),"true"); g[_remove](F||l(a,s)||"")}function q(a,b,d){var c=a[0],g=a.parent(),e=b==k,f=b==_indeterminate,m=b==n,s=f?_determinate:e?y:"enabled",q=l(a,s+t(c[_type])),r=l(a,b+t(c[_type]));if(!1!==c[b]){if(f||!d||"force"==d)c[b]=!1;D(a,e,s,d)}!c[n]&&l(a,_cursor,!0)&&g.find("."+C).css(_cursor,"pointer");g[_remove](r||l(a,b)||"");g.attr("role")&&!f&&g.attr("aria-"+(m?n:k),"false");g[_add](q||l(a,s)||"")}function E(a,b){if(a.data(m)){a.parent().html(a.attr("style",a.data(m).s||""));if(b)a[_callback](b);a.off(".i").unwrap(); f(_label+'[for="'+a[0].id+'"]').add(a.closest(_label)).off(".i")}}function l(a,b,f){if(a.data(m))return a.data(m).o[b+(f?"":"Class")]}function t(a){return a.charAt(0).toUpperCase()+a.slice(1)}function D(a,b,f,c){if(!c){if(b)a[_callback]("ifToggled");a[_callback]("ifChanged")[_callback]("if"+t(f))}}var m="iCheck",C=m+"-helper",r="radio",k="checked",y="un"+k,n="disabled";_determinate="determinate";_indeterminate="in"+_determinate;_update="update";_type="type";_click="click";_touch="touchbegin.i touchend.i"; _add="addClass";_remove="removeClass";_callback="trigger";_label="label";_cursor="cursor";_mobile=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);f.fn[m]=function(a,b){var d='input[type="checkbox"], input[type="'+r+'"]',c=f(),g=function(a){a.each(function(){var a=f(this);c=a.is(d)?c.add(a):c.add(a.find(d))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(a))return a=a.toLowerCase(),g(this),c.each(function(){var c= f(this);"destroy"==a?E(c,"ifDestroyed"):A(c,!0,a);f.isFunction(b)&&b()});if("object"!=typeof a&&a)return this;var e=f.extend({checkedClass:k,disabledClass:n,indeterminateClass:_indeterminate,labelHover:!0},a),l=e.handle,v=e.hoverClass||"hover",s=e.focusClass||"focus",t=e.activeClass||"active",B=!!e.labelHover,w=e.labelHoverClass||"hover",p=(""+e.increaseArea).replace("%","")|0;if("checkbox"==l||l==r)d='input[type="'+l+'"]';-50>p&&(p=-50);g(this);return c.each(function(){var a=f(this);E(a);var c=this, b=c.id,g=-p+"%",d=100+2*p+"%",d={position:"absolute",top:g,left:g,display:"block",width:d,height:d,margin:0,padding:0,background:"#fff",border:0,opacity:0},g=_mobile?{position:"absolute",visibility:"hidden"}:p?d:{position:"absolute",opacity:0},l="checkbox"==c[_type]?e.checkboxClass||"icheckbox":e.radioClass||"i"+r,z=f(_label+'[for="'+b+'"]').add(a.closest(_label)),u=!!e.aria,y=m+"-"+Math.random().toString(36).substr(2,6),h='
")[_callback]("ifCreated").parent().append(e.insert);d=f('').css(d).appendTo(h);a.data(m,{o:e,s:a.attr("style")}).css(g);e.inheritClass&&h[_add](c.className||"");e.inheritID&&b&&h.attr("id",m+"-"+b);"static"==h.css("position")&&h.css("position","relative");A(a,!0,_update);if(z.length)z.on(_click+".i mouseover.i mouseout.i "+_touch,function(b){var d=b[_type],e=f(this);if(!c[n]){if(d==_click){if(f(b.target).is("a"))return; A(a,!1,!0)}else B&&(/ut|nd/.test(d)?(h[_remove](v),e[_remove](w)):(h[_add](v),e[_add](w)));if(_mobile)b.stopPropagation();else return!1}});a.on(_click+".i focus.i blur.i keyup.i keydown.i keypress.i",function(b){var d=b[_type];b=b.keyCode;if(d==_click)return!1;if("keydown"==d&&32==b)return c[_type]==r&&c[k]||(c[k]?q(a,k):x(a,k)),!1;if("keyup"==d&&c[_type]==r)!c[k]&&x(a,k);else if(/us|ur/.test(d))h["blur"==d?_remove:_add](s)});d.on(_click+" mousedown mouseup mouseover mouseout "+_touch,function(b){var d= b[_type],e=/wn|up/.test(d)?t:v;if(!c[n]){if(d==_click)A(a,!1,!0);else{if(/wn|er|in/.test(d))h[_add](e);else h[_remove](e+" "+t);if(z.length&&B&&e==v)z[/ut|nd/.test(d)?_remove:_add](w)}if(_mobile)b.stopPropagation();else return!1}})})}})(window.jQuery||window.Zepto); var woof_redirect=''; var woof_reset_btn_action=false; jQuery(function ($){ jQuery('body').append(''); jQuery.extend(jQuery.fn, { within: function (pSelector){ return this.filter(function (){ return jQuery(this).closest(pSelector).length; }); }}); if(jQuery('#woof_results_by_ajax').length > 0){ woof_is_ajax=1; } woof_autosubmit=parseInt(jQuery('.woof').eq(0).data('autosubmit'), 10); woof_ajax_redraw=parseInt(jQuery('.woof').eq(0).data('ajax-redraw'), 10); woof_ext_init_functions=jQuery.parseJSON(woof_ext_init_functions); woof_init_native_woo_price_filter(); jQuery('body').bind('price_slider_change', function (event, min, max){ if(woof_autosubmit&&!woof_show_price_search_button&&jQuery('.price_slider_wrapper').length < 3){ jQuery('.woof .widget_price_filter form').trigger('submit'); }else{ var min_price=jQuery(this).find('.price_slider_amount #min_price').val(); var max_price=jQuery(this).find('.price_slider_amount #max_price').val(); woof_current_values.min_price=min_price; woof_current_values.max_price=max_price; }}); jQuery('body').on('change','.woof_price_filter_dropdown', function (){ var val=jQuery(this).val(); if(parseInt(val, 10)==-1){ delete woof_current_values.min_price; delete woof_current_values.max_price; }else{ var val=val.split("-"); woof_current_values.min_price=val[0]; woof_current_values.max_price=val[1]; } if(woof_autosubmit||jQuery(this).within('.woof').length==0){ woof_submit_link(woof_get_submit_link()); }}); woof_recount_text_price_filter(); jQuery('body').on('change','.woof_price_filter_txt', function (){ var from=parseInt(jQuery(this).parent().find('.woof_price_filter_txt_from').val(), 10); var to=parseInt(jQuery(this).parent().find('.woof_price_filter_txt_to').val(), 10); if(to < from||from < 0){ delete woof_current_values.min_price; delete woof_current_values.max_price; }else{ if(typeof woocs_current_currency!=='undefined'){ from=Math.ceil(from / parseFloat(woocs_current_currency.rate)); to=Math.ceil(to / parseFloat(woocs_current_currency.rate)); } woof_current_values.min_price=from; woof_current_values.max_price=to; } if(woof_autosubmit||jQuery(this).within('.woof').length==0){ woof_submit_link(woof_get_submit_link()); }}); jQuery('body').on('click','.woof_open_hidden_li_btn', function (){ var state=jQuery(this).data('state'); var type=jQuery(this).data('type'); if(state=='closed'){ jQuery(this).parents('.woof_list').find('.woof_hidden_term').addClass('woof_hidden_term2'); jQuery(this).parents('.woof_list').find('.woof_hidden_term').removeClass('woof_hidden_term'); if(type=='image'){ jQuery(this).find('img').attr('src', jQuery(this).data('opened')); }else{ jQuery(this).html(jQuery(this).data('opened')); } jQuery(this).data('state', 'opened'); }else{ jQuery(this).parents('.woof_list').find('.woof_hidden_term2').addClass('woof_hidden_term'); jQuery(this).parents('.woof_list').find('.woof_hidden_term2').removeClass('woof_hidden_term2'); if(type=='image'){ jQuery(this).find('img').attr('src', jQuery(this).data('closed')); }else{ jQuery(this).text(jQuery(this).data('closed')); } jQuery(this).data('state', 'closed'); } return false; }); woof_open_hidden_li(); jQuery('.widget_rating_filter li.wc-layered-nav-rating a').click(function (){ var is_chosen=jQuery(this).parent().hasClass('chosen'); var parsed_url=woof_parse_url(jQuery(this).attr('href')); var rate=0; if(parsed_url.query!==undefined){ if(parsed_url.query.indexOf('min_rating')!==-1){ var arrayOfStrings=parsed_url.query.split('min_rating='); rate=parseInt(arrayOfStrings[1], 10); }} jQuery(this).parents('ul').find('li').removeClass('chosen'); if(is_chosen){ delete woof_current_values.min_rating; }else{ woof_current_values.min_rating=rate; jQuery(this).parent().addClass('chosen'); } woof_submit_link(woof_get_submit_link()); return false; }); jQuery('body').on('click','.woof_start_filtering_btn', function (){ var shortcode=jQuery(this).parents('.woof').data('shortcode'); jQuery(this).html(woof_lang_loading); jQuery(this).addClass('woof_start_filtering_btn2'); jQuery(this).removeClass('woof_start_filtering_btn'); var data={ action: "woof_draw_products", page: 1, shortcode: 'woof_nothing', woof_shortcode: shortcode }; jQuery.post(woof_ajaxurl, data, function (content){ content=jQuery.parseJSON(content); jQuery('div.woof_redraw_zone').replaceWith(jQuery(content.form).find('.woof_redraw_zone')); woof_mass_reinit(); }); return false; }); var str=window.location.href; window.onpopstate=function (event){ try { console.log(woof_current_values) if(Object.keys(woof_current_values).length){ var temp=str.split('?'); var get1=""; if(temp[1]!=undefined){ get1=temp[1].split('#'); } var str2=window.location.href; var temp2=str2.split('?'); if(temp2[1]==undefined){ var get2={0:"",1:""};}else{ var get2=temp2[1].split('#'); } if(get2[0]!=get1[0]){ woof_show_info_popup(woof_lang_loading); window.location.reload(); } return false; }} catch (e){ console.log(e); }}; woof_init_ion_sliders(); woof_init_show_auto_form(); woof_init_hide_auto_form(); woof_remove_empty_elements(); woof_init_search_form(); woof_init_pagination(); woof_init_orderby(); woof_init_reset_button(); woof_init_beauty_scroll(); woof_draw_products_top_panel(); woof_shortcode_observer(); woof_init_tooltip(); if(!woof_is_ajax){ woof_redirect_init(); } woof_init_toggles(); }); function woof_redirect_init(){ try { if(jQuery('.woof').length){ if(undefined!==jQuery('.woof').val()){ woof_redirect=jQuery('.woof').eq(0).data('redirect'); if(woof_redirect.length > 0){ woof_shop_page=woof_current_page_link=woof_redirect; } return woof_redirect; }} } catch (e){ console.log(e); }} function woof_init_orderby(){ jQuery('body').on('submit','form.woocommerce-ordering', function (){ if(!jQuery("#is_woo_shortcode").length){ return false; } }); jQuery('body').on('change','form.woocommerce-ordering select.orderby', function (){ if(!jQuery("#is_woo_shortcode").length){ woof_current_values.orderby=jQuery(this).val(); woof_ajax_page_num=1; woof_submit_link(woof_get_submit_link(),0); return false; } }); } function woof_init_reset_button(){ jQuery('body').on('click','.woof_reset_search_form', function (){ woof_ajax_page_num=1; woof_ajax_redraw=0; woof_reset_btn_action=true; if(woof_is_permalink){ woof_current_values={}; woof_submit_link(woof_get_submit_link().split("page/")[0]); }else{ var link=woof_shop_page; if(woof_current_values.hasOwnProperty('page_id')){ link=location.protocol + '//' + location.host + "/?page_id=" + woof_current_values.page_id; woof_current_values={'page_id': woof_current_values.page_id}; woof_get_submit_link(); } woof_submit_link(link); if(woof_is_ajax){ history.pushState({}, "", link); if(woof_current_values.hasOwnProperty('page_id')){ woof_current_values={'page_id': woof_current_values.page_id};}else{ woof_current_values={};}} } return false; }); } function woof_init_pagination(){ if(woof_is_ajax===1){ jQuery('body').on('click','a.page-numbers', function (){ var l=jQuery(this).attr('href'); if(woof_ajax_first_done){ var res=l.split("paged="); if(typeof res[1]!=='undefined'){ woof_ajax_page_num=parseInt(res[1]); }else{ woof_ajax_page_num=1; } var res2=l.split("product-page="); if(typeof res2[1]!=='undefined'){ woof_ajax_page_num=parseInt(res2[1]); }}else{ var res=l.split("page/"); if(typeof res[1]!=='undefined'){ woof_ajax_page_num=parseInt(res[1]); }else{ woof_ajax_page_num=1; } var res2=l.split("product-page="); if(typeof res2[1]!=='undefined'){ woof_ajax_page_num=parseInt(res2[1]); }} { woof_submit_link(woof_get_submit_link(),0); } return false; }); }} function woof_init_search_form(){ woof_init_checkboxes(); woof_init_mselects(); woof_init_radios(); woof_price_filter_radio_init(); woof_init_selects(); if(woof_ext_init_functions!==null){ jQuery.each(woof_ext_init_functions, function (type, func){ eval(func + '()'); }); } jQuery('.woof_submit_search_form').click(function (){ if(woof_ajax_redraw){ woof_ajax_redraw=0; woof_is_ajax=0; } woof_submit_link(woof_get_submit_link()); return false; }); jQuery('ul.woof_childs_list').parent('li').addClass('woof_childs_list_li'); woof_remove_class_widget(); woof_checkboxes_slide(); } var woof_submit_link_locked=false; function woof_submit_link(link,ajax_redraw){ if(woof_submit_link_locked){ return; } if(typeof WoofTurboMode!='undefined'){ WoofTurboMode.woof_submit_link(link); return; } if(typeof ajax_redraw=='undefined'){ ajax_redraw=woof_ajax_redraw; } woof_submit_link_locked=true; woof_show_info_popup(woof_lang_loading); if(woof_is_ajax===1&&!ajax_redraw){ woof_ajax_first_done=true; var data={ action: "woof_draw_products", link: link, page: woof_ajax_page_num, shortcode: jQuery('#woof_results_by_ajax').data('shortcode'), woof_shortcode: jQuery('div.woof').data('shortcode') }; jQuery.post(woof_ajaxurl, data, function (content){ content=jQuery.parseJSON(content); if(jQuery('.woof_results_by_ajax_shortcode').length){ if(typeof content.products!="undefined"){ jQuery('#woof_results_by_ajax').replaceWith(content.products); }}else{ if(typeof content.products!="undefined"){ jQuery('.woof_shortcode_output').replaceWith(content.products); }} if(typeof content.additional_fields!="undefined"){ jQuery.each(content.additional_fields,function(selector,html_data){ jQuery(selector).replaceWith(html_data); }); } jQuery('div.woof_redraw_zone').replaceWith(jQuery(content.form).find('.woof_redraw_zone')); woof_draw_products_top_panel(); woof_mass_reinit(); woof_submit_link_locked=false; jQuery.each(jQuery('#woof_results_by_ajax'), function (index, item){ if(index==0){ return; } jQuery(item).removeAttr('id'); }); woof_infinite(); woof_js_after_ajax_done(); woof_change_link_addtocart(); woof_init_tooltip(); document.dispatchEvent(new CustomEvent('woof-ajax-form-redrawing', {detail: { link: link }})); }); }else{ if(ajax_redraw){ var data={ action: "woof_draw_products", link: link, page: 1, shortcode: 'woof_nothing', woof_shortcode: jQuery('div.woof').eq(0).data('shortcode') }; jQuery.post(woof_ajaxurl, data, function (content){ content=jQuery.parseJSON(content); jQuery('div.woof_redraw_zone').replaceWith(jQuery(content.form).find('.woof_redraw_zone')); woof_mass_reinit(); woof_submit_link_locked=false; woof_init_tooltip(); document.dispatchEvent(new CustomEvent('woof-ajax-form-redrawing', {detail: { link: link }})); }); }else{ window.location=link; woof_show_info_popup(woof_lang_loading); }} } function woof_remove_empty_elements(){ jQuery.each(jQuery('.woof_container select'), function (index, select){ var size=jQuery(select).find('option').length; if(size===0){ jQuery(select).parents('.woof_container').remove(); }}); jQuery.each(jQuery('ul.woof_list'), function (index, ch){ var size=jQuery(ch).find('li').length; if(size===0){ jQuery(ch).parents('.woof_container').remove(); }}); } function woof_get_submit_link(){ if(woof_is_ajax){ woof_current_values.page=woof_ajax_page_num; } if(Object.keys(woof_current_values).length > 0){ jQuery.each(woof_current_values, function (index, value){ if(index==swoof_search_slug){ delete woof_current_values[index]; } if(index=='s'){ delete woof_current_values[index]; } if(index=='product'){ delete woof_current_values[index]; } if(index=='really_curr_tax'){ delete woof_current_values[index]; }}); } if(Object.keys(woof_current_values).length===2){ if(('min_price' in woof_current_values)&&('max_price' in woof_current_values)){ woof_current_page_link=woof_current_page_link.replace(new RegExp(/page\/(\d+)\//), ""); var l=woof_current_page_link + '?min_price=' + woof_current_values.min_price + '&max_price=' + woof_current_values.max_price; if(woof_is_ajax){ history.pushState({}, "", l); } return l; }} if(Object.keys(woof_current_values).length===0){ if(woof_is_ajax){ history.pushState({}, "", woof_current_page_link); } return woof_current_page_link; } if(Object.keys(woof_really_curr_tax).length > 0){ woof_current_values['really_curr_tax']=woof_really_curr_tax.term_id + '-' + woof_really_curr_tax.taxonomy; } var link=woof_current_page_link + "?" + swoof_search_slug + "=1"; if(!woof_is_permalink){ if(woof_redirect.length > 0){ link=woof_redirect + "?" + swoof_search_slug + "=1"; if(woof_current_values.hasOwnProperty('page_id')){ delete woof_current_values.page_id; }}else{ link=location.protocol + '//' + location.host + "?" + swoof_search_slug + "=1"; }} var woof_exclude_accept_array=['path']; if(Object.keys(woof_current_values).length > 0){ jQuery.each(woof_current_values, function (index, value){ if(index=='page'&&woof_is_ajax){ index='paged'; } if(typeof value!=='undefined'){ if((typeof value&&value.length > 0)||typeof value=='number'){ if(jQuery.inArray(index, woof_exclude_accept_array)==-1){ link=link + "&" + index + "=" + value; }} }}); } link=link.replace(new RegExp(/page\/(\d+)\//), ""); if(woof_is_ajax){ history.pushState({}, "", link); } return link; } function woof_show_info_popup(text){ if(woof_overlay_skin=='default'){ jQuery("#woof_html_buffer").text(text); jQuery("#woof_html_buffer").fadeTo(200, 0.9); }else{ switch (woof_overlay_skin){ case 'loading-balls': case 'loading-bars': case 'loading-bubbles': case 'loading-cubes': case 'loading-cylon': case 'loading-spin': case 'loading-spinning-bubbles': case 'loading-spokes': jQuery('body').plainOverlay('show', {progress: function (){ return jQuery('
'); }}); break; default: jQuery('body').plainOverlay('show', {duration: -1}); break; }} } function woof_hide_info_popup(){ if(woof_overlay_skin=='default'){ window.setTimeout(function (){ jQuery("#woof_html_buffer").fadeOut(400); }, 200); }else{ jQuery('body').plainOverlay('hide'); }} function woof_draw_products_top_panel(){ if(woof_is_ajax){ jQuery('#woof_results_by_ajax').prev('.woof_products_top_panel').remove(); } var panel=jQuery('.woof_products_top_panel'); panel.html(''); if(Object.keys(woof_current_values).length > 0){ panel.show(); panel.html('
    '); var is_price_in=false; jQuery.each(woof_current_values, function (index, value){ if(jQuery.inArray(index, woof_accept_array)==-1&&jQuery.inArray(index.replace("rev_",""), woof_accept_array)==-1){ return; } if((index=='min_price'||index=='max_price')&&is_price_in){ return; } if((index=='min_price'||index=='max_price')&&!is_price_in){ is_price_in=true; index='price'; value=woof_lang_pricerange; } value=value.toString().trim(); if(value.search(',')){ value=value.split(','); } jQuery.each(value, function (i, v){ if(index=='page'){ return; } if(index=='post_type'){ return; } var txt=v; if(index=='orderby'){ if(woof_lang[v]=="menu order"){ woof_lang[v]="Oletus"; } else if(woof_lang[v]=="popularity"){ woof_lang[v]="Myydyimmät"; } else if(woof_lang[v]=="date"){ woof_lang[v]="Uusimmat"; } else if(woof_lang[v]=="price low to high"){ woof_lang[v]="Tarjoukset"; }else{ woof_lang[v]="Tarjoukset"; } if(woof_lang[v]!==undefined){ txt='Valinnat' + ': ' + woof_lang[v]; }else{ txt=woof_lang.orderby + ': ' + v; }}else if(index=='perpage'){ txt=woof_lang.perpage; }else if(index=='price'){ txt=woof_lang.pricerange; }else{ var is_in_custom=false; if(Object.keys(woof_lang_custom).length > 0){ jQuery.each(woof_lang_custom, function (i, tt){ if(i==index){ is_in_custom=true; txt=tt; if(index=='woof_sku'){ txt +=" " + v; }} }); } if(!is_in_custom){ try { txt=jQuery("input[data-anchor='woof_n_" + index + '_' + v + "']").val(); } catch (e){ console.log(e); } if(typeof txt==='undefined'){ txt=v; }} } panel.find('ul').append(jQuery('
  • ').append(jQuery('').attr('href', "").attr('data-tax', index).attr('data-slug', v).append(jQuery('').attr('class', 'woof_remove_ppi').append(txt) ))); }); }); } if(jQuery(panel).find('li').length==0||!jQuery('.woof_products_top_panel').length){ panel.hide(); } jQuery('.woof_remove_ppi').parent().click(function (){ var tax=jQuery(this).data('tax'); var name=jQuery(this).data('slug'); if(tax!='price'){ values=woof_current_values[tax]; values=values.split(','); var tmp=[]; jQuery.each(values, function (index, value){ if(value!=name){ tmp.push(value); }}); values=tmp; if(values.length){ woof_current_values[tax]=values.join(','); }else{ delete woof_current_values[tax]; }}else{ delete woof_current_values['min_price']; delete woof_current_values['max_price']; } woof_ajax_page_num=1; woof_reset_btn_action=true; { woof_submit_link(woof_get_submit_link()); } jQuery('.woof_products_top_panel').find("[data-tax='" + tax + "'][href='" + name + "']").hide(333); return false; }); } function woof_shortcode_observer(){ var redirect=true; if(jQuery('.woof_shortcode_output').length||(jQuery('.woocommerce .products').length&&!jQuery('.single-product').length)){ redirect=false; } if(jQuery('.woocommerce .woocommerce-info').length){ redirect=false; } if(typeof woof_not_redirect!=='undefined'&&woof_not_redirect==1){ redirect=false; } if(jQuery('.woopt-data-table').length){ redirect=false; } if(!redirect){ woof_current_page_link=location.protocol + '//' + location.host + location.pathname; } if(jQuery('#woof_results_by_ajax').length){ woof_is_ajax=1; }} function woof_init_beauty_scroll(){ if(woof_use_beauty_scroll){ try { var anchor=".woof_section_scrolled, .woof_sid_auto_shortcode .woof_container_radio .woof_block_html_items, .woof_sid_auto_shortcode .woof_container_checkbox .woof_block_html_items, .woof_sid_auto_shortcode .woof_container_label .woof_block_html_items"; jQuery("" + anchor).mCustomScrollbar('destroy'); jQuery("" + anchor).mCustomScrollbar({ scrollButtons: { enable: true }, advanced: { updateOnContentResize: true, updateOnBrowserResize: true }, theme: "dark-2", horizontalScroll: false, mouseWheel: true, scrollType: 'pixels', contentTouchScroll: true }); } catch (e){ console.log(e); }} } function woof_remove_class_widget(){ jQuery('.woof_container_inner').find('.widget').removeClass('widget'); } function woof_init_show_auto_form(){ jQuery('.woof_show_auto_form').unbind('click'); jQuery('.woof_show_auto_form').click(function (){ var _this=this; jQuery(_this).addClass('woof_hide_auto_form').removeClass('woof_show_auto_form'); jQuery(".woof_auto_show").show().animate({ height: (jQuery(".woof_auto_show_indent").height() + 20) + "px", opacity: 1 }, 377, function (){ woof_init_hide_auto_form(); jQuery('.woof_auto_show').removeClass('woof_overflow_hidden'); jQuery('.woof_auto_show_indent').removeClass('woof_overflow_hidden'); jQuery(".woof_auto_show").height('auto'); }); return false; }); } function woof_init_hide_auto_form(){ jQuery('.woof_hide_auto_form').unbind('click'); jQuery('.woof_hide_auto_form').click(function (){ var _this=this; jQuery(_this).addClass('woof_show_auto_form').removeClass('woof_hide_auto_form'); jQuery(".woof_auto_show").show().animate({ height: "1px", opacity: 0 }, 377, function (){ jQuery('.woof_auto_show').addClass('woof_overflow_hidden'); jQuery('.woof_auto_show_indent').addClass('woof_overflow_hidden'); woof_init_show_auto_form(); }); return false; }); } function woof_checkboxes_slide(){ if(woof_checkboxes_slide_flag==true){ var childs=jQuery('ul.woof_childs_list'); if(childs.length){ jQuery.each(childs, function (index, ul){ if(jQuery(ul).parents('.woof_no_close_childs').length){ return; } var span_class='woof_is_closed'; if(woof_supports_html5_storage()){ var preulstate=localStorage.getItem(jQuery(ul).closest('li').attr("class")); if(preulstate&&preulstate=='woof_is_opened'){ var span_class='woof_is_opened'; jQuery(ul).show(); } jQuery(ul).before(''); }else{ if(jQuery(ul).find('input[type=checkbox],input[type=radio]').is(':checked')){ jQuery(ul).show(); span_class='woof_is_opened'; } jQuery(ul).before(''); }}); jQuery.each(jQuery('a.woof_childs_list_opener span'), function (index, a){ jQuery(a).click(function (){ var span=jQuery(this); var this_=jQuery(this).parent(".woof_childs_list_opener"); if(span.hasClass('woof_is_closed')){ jQuery(this_).parent().find('ul.woof_childs_list').first().show(333); span.removeClass('woof_is_closed'); span.addClass('woof_is_opened'); }else{ jQuery(this_).parent().find('ul.woof_childs_list').first().hide(333); span.removeClass('woof_is_opened'); span.addClass('woof_is_closed'); } if(woof_supports_html5_storage()){ var ullabel=jQuery(this_).closest('li').attr("class"); var ullstate=jQuery(this_).children("span").attr("class"); localStorage.setItem(ullabel, ullstate); } return false; }); }); }} } function woof_init_ion_sliders(){ jQuery.each(jQuery('.woof_range_slider'), function (index, input){ try { jQuery(input).ionRangeSlider({ min: jQuery(input).data('min'), max: jQuery(input).data('max'), from: jQuery(input).data('min-now'), to: jQuery(input).data('max-now'), type: 'double', prefix: jQuery(input).data('slider-prefix'), postfix: jQuery(input).data('slider-postfix'), prettify: true, hideMinMax: false, hideFromTo: false, grid: true, step: jQuery(input).data('step'), onFinish: function (ui){ var tax=jQuery(input).data('taxes'); woof_current_values.min_price=(parseInt(ui.from, 10)/tax); woof_current_values.max_price=(parseInt(ui.to, 10)/tax); if(typeof woocs_current_currency!=='undefined'){ woof_current_values.min_price=Math.ceil(woof_current_values.min_price / parseFloat(woocs_current_currency.rate)); woof_current_values.max_price=Math.ceil(woof_current_values.max_price / parseFloat(woocs_current_currency.rate)); } woof_ajax_page_num=1; if(woof_autosubmit||jQuery(input).within('.woof').length==0){ woof_submit_link(woof_get_submit_link()); } return false; }}); } catch (e){ }}); } function woof_init_native_woo_price_filter(){ jQuery('.widget_price_filter form').unbind('submit'); jQuery('.widget_price_filter form').submit(function (){ var min_price=jQuery(this).find('.price_slider_amount #min_price').val(); var max_price=jQuery(this).find('.price_slider_amount #max_price').val(); woof_current_values.min_price=min_price; woof_current_values.max_price=max_price; woof_ajax_page_num=1; if(woof_autosubmit){ woof_submit_link(woof_get_submit_link(),0); } return false; }); } function woof_reinit_native_woo_price_filter(){ if(typeof woocommerce_price_slider_params==='undefined'){ return false; } jQuery('input#min_price, input#max_price').hide(); jQuery('.price_slider, .price_label').show(); var min_price=jQuery('.price_slider_amount #min_price').data('min'), max_price=jQuery('.price_slider_amount #max_price').data('max'), current_min_price=parseInt(min_price, 10), current_max_price=parseInt(max_price, 10); if(woof_current_values.hasOwnProperty('min_price')){ current_min_price=parseInt(woof_current_values.min_price, 10); current_max_price=parseInt(woof_current_values.max_price, 10); }else{ if(woocommerce_price_slider_params.min_price){ current_min_price=parseInt(woocommerce_price_slider_params.min_price, 10); } if(woocommerce_price_slider_params.max_price){ current_max_price=parseInt(woocommerce_price_slider_params.max_price, 10); }} var currency_symbol=woocommerce_price_slider_params.currency_symbol; if(typeof currency_symbol=='undefined'){ currency_symbol=woocommerce_price_slider_params.currency_format_symbol; } jQuery(document.body).bind('price_slider_create price_slider_slide', function (event, min, max){ if(typeof woocs_current_currency!=='undefined'){ var label_min=min; var label_max=max; if(typeof currency_symbol=='undefined'){ currency_symbol=woocs_current_currency.symbol } if(woocs_current_currency.rate!==1){ label_min=Math.ceil(label_min * parseFloat(woocs_current_currency.rate)); label_max=Math.ceil(label_max * parseFloat(woocs_current_currency.rate)); } label_min=woof_front_number_format(label_min, 2, '.', ','); label_max=woof_front_number_format(label_max, 2, '.', ','); if(jQuery.inArray(woocs_current_currency.name, woocs_array_no_cents)||woocs_current_currency.hide_cents==1){ label_min=label_min.replace('.00', ''); label_max=label_max.replace('.00', ''); } if(woocs_current_currency.position==='left'){ jQuery('.price_slider_amount span.from').html(currency_symbol + label_min); jQuery('.price_slider_amount span.to').html(currency_symbol + label_max); }else if(woocs_current_currency.position==='left_space'){ jQuery('.price_slider_amount span.from').html(currency_symbol + " " + label_min); jQuery('.price_slider_amount span.to').html(currency_symbol + " " + label_max); }else if(woocs_current_currency.position==='right'){ jQuery('.price_slider_amount span.from').html(label_min + currency_symbol); jQuery('.price_slider_amount span.to').html(label_max + currency_symbol); }else if(woocs_current_currency.position==='right_space'){ jQuery('.price_slider_amount span.from').html(label_min + " " + currency_symbol); jQuery('.price_slider_amount span.to').html(label_max + " " + currency_symbol); }}else{ if(woocommerce_price_slider_params.currency_pos==='left'){ jQuery('.price_slider_amount span.from').html(currency_symbol + min); jQuery('.price_slider_amount span.to').html(currency_symbol + max); }else if(woocommerce_price_slider_params.currency_pos==='left_space'){ jQuery('.price_slider_amount span.from').html(currency_symbol + ' ' + min); jQuery('.price_slider_amount span.to').html(currency_symbol + ' ' + max); }else if(woocommerce_price_slider_params.currency_pos==='right'){ jQuery('.price_slider_amount span.from').html(min + currency_symbol); jQuery('.price_slider_amount span.to').html(max + currency_symbol); }else if(woocommerce_price_slider_params.currency_pos==='right_space'){ jQuery('.price_slider_amount span.from').html(min + ' ' + currency_symbol); jQuery('.price_slider_amount span.to').html(max + ' ' + currency_symbol); }} jQuery(document.body).trigger('price_slider_updated', [min, max]); }); jQuery('.price_slider').slider({ range: true, animate: true, min: min_price, max: max_price, values: [current_min_price, current_max_price], create: function (){ jQuery('.price_slider_amount #min_price').val(current_min_price); jQuery('.price_slider_amount #max_price').val(current_max_price); jQuery(document.body).trigger('price_slider_create', [current_min_price, current_max_price]); }, slide: function (event, ui){ jQuery('input#min_price').val(ui.values[0]); jQuery('input#max_price').val(ui.values[1]); jQuery(document.body).trigger('price_slider_slide', [ui.values[0], ui.values[1]]); }, change: function (event, ui){ jQuery(document.body).trigger('price_slider_change', [ui.values[0], ui.values[1]]); }}); woof_init_native_woo_price_filter(); } function woof_mass_reinit(){ woof_remove_empty_elements(); woof_open_hidden_li(); woof_init_search_form(); woof_hide_info_popup(); woof_init_beauty_scroll(); woof_init_ion_sliders(); woof_reinit_native_woo_price_filter(); woof_recount_text_price_filter(); woof_draw_products_top_panel(); } function woof_recount_text_price_filter(){ if(typeof woocs_current_currency!=='undefined'){ jQuery.each(jQuery('.woof_price_filter_txt_from, .woof_price_filter_txt_to'), function (i, item){ jQuery(this).val(Math.ceil(jQuery(this).data('value'))); }); }} function woof_init_toggles(){ jQuery('body').on('click','.woof_front_toggle', function (){ if(jQuery(this).data('condition')=='opened'){ jQuery(this).removeClass('woof_front_toggle_opened'); jQuery(this).addClass('woof_front_toggle_closed'); jQuery(this).data('condition', 'closed'); if(woof_toggle_type=='text'){ jQuery(this).text(woof_toggle_closed_text); }else{ jQuery(this).find('img').prop('src', woof_toggle_closed_image); }}else{ jQuery(this).addClass('woof_front_toggle_opened'); jQuery(this).removeClass('woof_front_toggle_closed'); jQuery(this).data('condition', 'opened'); if(woof_toggle_type=='text'){ jQuery(this).text(woof_toggle_opened_text); }else{ jQuery(this).find('img').prop('src', woof_toggle_opened_image); }} jQuery(this).parents('.woof_container_inner').find('.woof_block_html_items').toggle(500); return false; }); } function woof_open_hidden_li(){ if(jQuery('.woof_open_hidden_li_btn').length > 0){ jQuery.each(jQuery('.woof_open_hidden_li_btn'), function (i, b){ if(jQuery(b).parents('ul').find('li.woof_hidden_term input[type=checkbox],li.woof_hidden_term input[type=radio]').is(':checked')){ jQuery(b).trigger('click'); }}); }} function $_woof_GET(q, s){ s=(s) ? s:window.location.search; var re=new RegExp('&' + q + '=([^&]*)', 'i'); return (s=s.replace(/^\?/, '&').match(re)) ? s=s[1]:s=''; } function woof_parse_url(url){ var pattern=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"); var matches=url.match(pattern); return { scheme: matches[2], authority: matches[4], path: matches[5], query: matches[7], fragment: matches[9] };} function woof_price_filter_radio_init(){ if(icheck_skin!='none'){ jQuery('.woof_price_filter_radio').iCheck('destroy'); jQuery('.woof_price_filter_radio').iCheck({ radioClass: 'iradio_' + icheck_skin.skin + '-' + icheck_skin.color, }); jQuery('.woof_price_filter_radio').siblings('div').removeClass('checked'); jQuery('.woof_price_filter_radio').unbind('ifChecked'); jQuery('.woof_price_filter_radio').on('ifChecked', function (event){ jQuery(this).attr("checked", true); jQuery('.woof_radio_price_reset').removeClass('woof_radio_term_reset_visible'); jQuery(this).parents('.woof_list').find('.woof_radio_price_reset').removeClass('woof_radio_term_reset_visible'); jQuery(this).parents('.woof_list').find('.woof_radio_price_reset').hide(); jQuery(this).parents('li').eq(0).find('.woof_radio_price_reset').eq(0).addClass('woof_radio_term_reset_visible'); var val=jQuery(this).val(); if(parseInt(val, 10)==-1){ delete woof_current_values.min_price; delete woof_current_values.max_price; jQuery(this).removeAttr('checked'); jQuery(this).siblings('.woof_radio_price_reset').removeClass('woof_radio_term_reset_visible'); }else{ var val=val.split("-"); woof_current_values.min_price=val[0]; woof_current_values.max_price=val[1]; jQuery(this).siblings('.woof_radio_price_reset').addClass('woof_radio_term_reset_visible'); jQuery(this).attr("checked", true); } if(woof_autosubmit||jQuery(this).within('.woof').length==0){ woof_submit_link(woof_get_submit_link()); }}); }else{ jQuery('body').on('change','.woof_price_filter_radio', function (){ var val=jQuery(this).val(); jQuery('.woof_radio_price_reset').removeClass('woof_radio_term_reset_visible'); if(parseInt(val, 10)==-1){ delete woof_current_values.min_price; delete woof_current_values.max_price; jQuery(this).removeAttr('checked'); jQuery(this).siblings('.woof_radio_price_reset').removeClass('woof_radio_term_reset_visible'); }else{ var val=val.split("-"); woof_current_values.min_price=val[0]; woof_current_values.max_price=val[1]; jQuery(this).siblings('.woof_radio_price_reset').addClass('woof_radio_term_reset_visible'); jQuery(this).attr("checked", true); } if(woof_autosubmit||jQuery(this).within('.woof').length==0){ woof_submit_link(woof_get_submit_link()); }}); } jQuery('.woof_radio_price_reset').click(function (){ delete woof_current_values.min_price; delete woof_current_values.max_price; jQuery(this).siblings('div').removeClass('checked'); jQuery(this).parents('.woof_list').find('input[type=radio]').removeAttr('checked'); jQuery(this).removeClass('woof_radio_term_reset_visible'); if(woof_autosubmit){ woof_submit_link(woof_get_submit_link()); } return false; }); } function woof_serialize(serializedString){ var str=decodeURI(serializedString); var pairs=str.split('&'); var obj={}, p, idx, val; for (var i=0, n=pairs.length; i < n; i++){ p=pairs[i].split('='); idx=p[0]; if(idx.indexOf("[]")==(idx.length - 2)){ var ind=idx.substring(0, idx.length - 2) if(obj[ind]===undefined){ obj[ind]=[]; } obj[ind].push(p[1]); }else{ obj[idx]=p[1]; }} return obj; } function woof_infinite(){ if(typeof yith_infs==='undefined'){ return; } var infinite_scroll1={ 'nextSelector': '.woocommerce-pagination li .next', 'navSelector': yith_infs.navSelector, 'itemSelector': yith_infs.itemSelector, 'contentSelector': yith_infs.contentSelector, 'loader': '', 'is_shop': yith_infs.shop }; var curr_l=window.location.href; var curr_link=curr_l.split('?'); var get=""; if(curr_link[1]!=undefined){ var temp=woof_serialize(curr_link[1]); delete temp['paged']; get=decodeURIComponent(jQuery.param(temp)) } var page_link=jQuery('.woocommerce-pagination li .next').attr("href"); if(page_link==undefined){ page_link=curr_link+"page/1/" } var ajax_link=page_link.split('?'); var page=""; if(ajax_link[1]!=undefined){ var temp1=woof_serialize(ajax_link[1]); if(temp1['paged']!=undefined){ page="page/"+ temp1['paged']+"/"; }} page_link=curr_link[0] +page+ '?' + get; jQuery('.woocommerce-pagination li .next').attr('href', page_link); jQuery(window).unbind("yith_infs_start"), jQuery(yith_infs.contentSelector).yit_infinitescroll(infinite_scroll1) } function woof_change_link_addtocart(){ if(!woof_is_ajax){ return; } jQuery(".add_to_cart_button").each(function(i,elem){ var link=jQuery(elem).attr('href'); var link_items=link.split("?"); var site_link_items=window.location.href.split("?"); if(link_items[1]!=undefined){ link=site_link_items[0]+"?"+link_items[1]; jQuery(elem).attr('href',link); }}); } function woof_front_number_format(number, decimals, dec_point, thousands_sep){ number=(number + '') .replace(/[^0-9+\-Ee.]/g, ''); var n = !isFinite(+number) ? 0:+number, prec = !isFinite(+decimals) ? 0:Math.abs(decimals), sep=(typeof thousands_sep==='undefined') ? ',':thousands_sep, dec=(typeof dec_point==='undefined') ? '.':dec_point, s='', toFixedFix=function (n, prec){ var k=Math.pow(10, prec); return '' + (Math.round(n * k) / k) .toFixed(prec); }; s=(prec ? toFixedFix(n, prec):'' + Math.round(n)) .split('.'); if(s[0].length > 3){ s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep); } if((s[1]||'') .length < prec){ s[1]=s[1]||''; s[1] +=new Array(prec - s[1].length + 1) .join('0'); } return s.join(dec); } function woof_supports_html5_storage(){ try { return 'localStorage' in window&&window['localStorage']!==null; } catch (e){ return false; }} function woof_init_tooltip(){ var tooltips=jQuery(".woof_tooltip_header"); if(tooltips.length){ jQuery(tooltips).tooltipster({ theme: 'tooltipster-noir', side: 'right' }); }}; function woof_init_radios(){ if(icheck_skin!='none'){ jQuery('.woof_radio_term').iCheck('destroy'); jQuery('.woof_radio_term').iCheck({ radioClass: 'iradio_' + icheck_skin.skin + '-' + icheck_skin.color, }); jQuery('.woof_radio_term').unbind('ifChecked'); jQuery('.woof_radio_term').on('ifChecked', function (event){ jQuery(this).attr("checked", true); jQuery(this).parents('.woof_list').find('.woof_radio_term_reset').removeClass('woof_radio_term_reset_visible'); jQuery(this).parents('.woof_list').find('.woof_radio_term_reset').hide(); jQuery(this).parents('li').eq(0).find('.woof_radio_term_reset').eq(0).addClass('woof_radio_term_reset_visible'); var slug=jQuery(this).data('slug'); var name=jQuery(this).attr('name'); var term_id=jQuery(this).data('term-id'); woof_radio_direct_search(term_id, name, slug); }); }else{ jQuery('.woof_radio_term').on('change', function (event){ jQuery(this).attr("checked", true); var slug=jQuery(this).data('slug'); var name=jQuery(this).attr('name'); var term_id=jQuery(this).data('term-id'); jQuery(this).parents('.woof_list').find('.woof_radio_term_reset').removeClass('woof_radio_term_reset_visible'); jQuery(this).parents('.woof_list').find('.woof_radio_term_reset').hide(); jQuery(this).parents('li').eq(0).find('.woof_radio_term_reset').eq(0).addClass('woof_radio_term_reset_visible'); woof_radio_direct_search(term_id, name, slug); }); } jQuery('.woof_radio_term_reset').click(function (){ woof_radio_direct_search(jQuery(this).data('term-id'), jQuery(this).attr('data-name'), 0); jQuery(this).parents('.woof_list').find('.checked').removeClass('checked'); jQuery(this).parents('.woof_list').find('input[type=radio]').removeAttr('checked'); jQuery(this).removeClass('woof_radio_term_reset_visible'); return false; }); } function woof_radio_direct_search(term_id, name, slug){ jQuery.each(woof_current_values, function (index, value){ if(index==name){ delete woof_current_values[name]; return; }}); if(slug!=0){ woof_current_values[name]=slug; jQuery('a.woof_radio_term_reset_' + term_id).hide(); jQuery('woof_radio_term_' + term_id).filter(':checked').parents('li').find('a.woof_radio_term_reset').show(); jQuery('woof_radio_term_' + term_id).parents('ul.woof_list').find('label').css({'fontWeight': 'normal'}); jQuery('woof_radio_term_' + term_id).filter(':checked').parents('li').find('label.woof_radio_label_' + slug).css({'fontWeight': 'bold'}); }else{ jQuery('a.woof_radio_term_reset_' + term_id).hide(); jQuery('woof_radio_term_' + term_id).attr('checked', false); jQuery('woof_radio_term_' + term_id).parent().removeClass('checked'); jQuery('woof_radio_term_' + term_id).parents('ul.woof_list').find('label').css({'fontWeight': 'normal'}); } woof_ajax_page_num=1; if(woof_autosubmit){ woof_submit_link(woof_get_submit_link()); }}; function woof_init_checkboxes(){ if(icheck_skin!='none'){ jQuery('.woof_checkbox_term').iCheck('destroy'); jQuery('.woof_checkbox_term').iCheck({ checkboxClass: 'icheckbox_' + icheck_skin.skin + '-' + icheck_skin.color, }); jQuery('.woof_checkbox_term').unbind('ifChecked'); jQuery('.woof_checkbox_term').on('ifChecked', function (event){ jQuery(this).attr("checked", true); jQuery(".woof_select_radio_check input").attr('disabled','disabled'); woof_checkbox_process_data(this, true); }); jQuery('.woof_checkbox_term').unbind('ifUnchecked'); jQuery('.woof_checkbox_term').on('ifUnchecked', function (event){ jQuery(this).attr("checked", false); woof_checkbox_process_data(this, false); }); jQuery('.woof_checkbox_label').unbind(); jQuery('label.woof_checkbox_label').click(function (){ if(jQuery(this).prev().find('.woof_checkbox_term').is(':disabled')){ return false; } if(jQuery(this).prev().find('.woof_checkbox_term').is(':checked')){ jQuery(this).prev().find('.woof_checkbox_term').trigger('ifUnchecked'); jQuery(this).prev().removeClass('checked'); }else{ jQuery(this).prev().find('.woof_checkbox_term').trigger('ifChecked'); jQuery(this).prev().addClass('checked'); }}); }else{ jQuery('.woof_checkbox_term').on('change', function (event){ if(jQuery(this).is(':checked')){ jQuery(this).attr("checked", true); woof_checkbox_process_data(this, true); }else{ jQuery(this).attr("checked", false); woof_checkbox_process_data(this, false); }}); }} function woof_checkbox_process_data(_this, is_checked){ var tax=jQuery(_this).data('tax'); var name=jQuery(_this).attr('name'); var term_id=jQuery(_this).data('term-id'); woof_checkbox_direct_search(term_id, name, tax, is_checked); } function woof_checkbox_direct_search(term_id, name, tax, is_checked){ var values=''; var checked=true; if(is_checked){ if(tax in woof_current_values){ woof_current_values[tax]=woof_current_values[tax] + ',' + name; }else{ woof_current_values[tax]=name; } checked=true; }else{ values=woof_current_values[tax]; values=values.split(','); var tmp=[]; jQuery.each(values, function (index, value){ if(value!=name){ tmp.push(value); }}); values=tmp; if(values.length){ woof_current_values[tax]=values.join(','); }else{ delete woof_current_values[tax]; } checked=false; } jQuery('.woof_checkbox_term_' + term_id).attr('checked', checked); woof_ajax_page_num=1; if(woof_autosubmit){ woof_submit_link(woof_get_submit_link()); }}; function woof_init_selects(){ if(is_woof_use_chosen){ try { jQuery("select.woof_select, select.woof_price_filter_dropdown").chosen(); } catch (e){ }} jQuery('.woof_select').change(function (){ var slug=jQuery(this).val(); var name=jQuery(this).attr('name'); woof_select_direct_search(this, name, slug); }); } function woof_select_direct_search(_this, name, slug){ jQuery.each(woof_current_values, function (index, value){ if(index==name){ delete woof_current_values[name]; return; }}); if(slug!=0){ woof_current_values[name]=slug; } woof_ajax_page_num=1; if(woof_autosubmit||jQuery(_this).within('.woof').length==0){ woof_submit_link(woof_get_submit_link()); }}; function woof_init_mselects(){ try { jQuery("select.woof_mselect").chosen(); } catch (e){ } jQuery('.woof_mselect').change(function (a){ var slug=jQuery(this).val(); var name=jQuery(this).attr('name'); if(is_woof_use_chosen){ var vals=jQuery(this).chosen().val(); jQuery('.woof_mselect[name=' + name + '] option:selected').removeAttr("selected"); jQuery('.woof_mselect[name=' + name + '] option').each(function (i, option){ var v=jQuery(this).val(); if(jQuery.inArray(v, vals)!==-1){ jQuery(this).prop("selected", true); }}); } woof_mselect_direct_search(name, slug); return true; }); } function woof_mselect_direct_search(name, slug){ var values=[]; jQuery('.woof_mselect[name=' + name + '] option:selected').each(function (i, v){ values.push(jQuery(this).val()); }); values=values.filter(function (item, pos){ return values.indexOf(item)==pos; }); values=values.join(','); if(values.length){ woof_current_values[name]=values; }else{ delete woof_current_values[name]; } woof_ajax_page_num=1; if(woof_autosubmit){ woof_submit_link(woof_get_submit_link()); }}; (function (){ var $, AbstractChosen, Chosen, SelectParser, _ref, __hasProp={}.hasOwnProperty, __extends=function (child, parent){ for (var key in parent){ if(__hasProp.call(parent, key)) child[key]=parent[key]; } function ctor(){ this.constructor=child; } ctor.prototype=parent.prototype; child.prototype=new ctor(); child.__super__=parent.prototype; return child; }; SelectParser=(function (){ function SelectParser(){ this.options_index=0; this.parsed=[]; } SelectParser.prototype.add_node=function (child){ if(child.nodeName.toUpperCase()==="OPTGROUP"){ return this.add_group(child); }else{ return this.add_option(child); }}; SelectParser.prototype.add_group=function (group){ var group_position, option, _i, _len, _ref, _results; group_position=this.parsed.length; this.parsed.push({ array_index: group_position, group: true, label: this.escapeExpression(group.label), children: 0, disabled: group.disabled }); _ref=group.childNodes; _results=[]; for (_i=0, _len=_ref.length; _i < _len; _i++){ option=_ref[_i]; _results.push(this.add_option(option, group_position, group.disabled)); } return _results; }; SelectParser.prototype.add_option=function (option, group_position, group_disabled){ if(option.nodeName.toUpperCase()==="OPTION"){ if(option.text!==""){ if(group_position!=null){ this.parsed[group_position].children +=1; } this.parsed.push({ array_index: this.parsed.length, options_index: this.options_index, value: option.value, text: option.text, html: option.innerHTML, selected: option.selected, disabled: group_disabled===true ? group_disabled:option.disabled, group_array_index: group_position, classes: option.className, style: option.style.cssText }); }else{ this.parsed.push({ array_index: this.parsed.length, options_index: this.options_index, empty: true }); } return this.options_index +=1; }}; SelectParser.prototype.escapeExpression=function (text){ var map, unsafe_chars; if((text==null)||text===false){ return ""; } if(!/[\&\<\>\"\'\`]/.test(text)){ return text; } map={ "<": "<", ">": ">", '"': """, "'": "'", "`": "`" }; unsafe_chars=/&(?!\w+;)|[\<\>\"\'\`]/g; return text.replace(unsafe_chars, function (chr){ return map[chr]||"&"; }); }; return SelectParser; })(); SelectParser.select_to_array=function (select){ var child, parser, _i, _len, _ref; parser=new SelectParser(); _ref=select.childNodes; for (_i=0, _len=_ref.length; _i < _len; _i++){ child=_ref[_i]; parser.add_node(child); } return parser.parsed; }; AbstractChosen=(function (){ function AbstractChosen(form_field, options){ this.form_field=form_field; this.options=options!=null ? options:{}; if(!AbstractChosen.browser_is_supported()){ return; } this.is_multiple=this.form_field.multiple; this.set_default_text(); this.set_default_values(); this.setup(); this.set_up_html(); this.register_observers(); } AbstractChosen.prototype.set_default_values=function (){ var _this=this; this.click_test_action=function (evt){ return _this.test_active_click(evt); }; this.activate_action=function (evt){ return _this.activate_field(evt); }; this.active_field=false; this.mouse_on_container=false; this.results_showing=false; this.result_highlighted=null; this.allow_single_deselect=(this.options.allow_single_deselect!=null)&&(this.form_field.options[0]!=null)&&this.form_field.options[0].text==="" ? this.options.allow_single_deselect:false; this.disable_search_threshold=this.options.disable_search_threshold||0; this.disable_search=this.options.disable_search||false; this.enable_split_word_search=this.options.enable_split_word_search!=null ? this.options.enable_split_word_search:true; this.group_search=this.options.group_search!=null ? this.options.group_search:true; this.search_contains=this.options.search_contains||false; this.single_backstroke_delete=this.options.single_backstroke_delete!=null ? this.options.single_backstroke_delete:true; this.max_selected_options=this.options.max_selected_options||Infinity; this.inherit_select_classes=this.options.inherit_select_classes||false; this.display_selected_options=this.options.display_selected_options!=null ? this.options.display_selected_options:true; return this.display_disabled_options=this.options.display_disabled_options!=null ? this.options.display_disabled_options:true; }; AbstractChosen.prototype.set_default_text=function (){ if(this.form_field.getAttribute("data-placeholder")){ this.default_text=this.form_field.getAttribute("data-placeholder"); }else if(this.is_multiple){ this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text; }else{ this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text; } return this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text; }; AbstractChosen.prototype.mouse_enter=function (){ return this.mouse_on_container=true; }; AbstractChosen.prototype.mouse_leave=function (){ return this.mouse_on_container=false; }; AbstractChosen.prototype.input_focus=function (evt){ var _this=this; if(this.is_multiple){ if(!this.active_field){ return setTimeout((function (){ return _this.container_mousedown(); }), 50); }}else{ if(!this.active_field){ return this.activate_field(); }} }; AbstractChosen.prototype.input_blur=function (evt){ var _this=this; if(!this.mouse_on_container){ this.active_field=false; return setTimeout((function (){ return _this.blur_test(); }), 100); }}; AbstractChosen.prototype.results_option_build=function (options){ var content, data, _i, _len, _ref; content=''; _ref=this.results_data; for (_i=0, _len=_ref.length; _i < _len; _i++){ data=_ref[_i]; if(data.group){ content +=this.result_add_group(data); }else{ content +=this.result_add_option(data); } if(options!=null ? options.first:void 0){ if(data.selected&&this.is_multiple){ this.choice_build(data); }else if(data.selected&&!this.is_multiple){ this.single_set_selected_text(data.text); }} } return content; }; AbstractChosen.prototype.result_add_option=function (option){ var classes, option_el; if(!option.search_match){ return ''; } if(!this.include_option_in_results(option)){ return ''; } classes=[]; if(!option.disabled&&!(option.selected&&this.is_multiple)){ classes.push("active-result"); } if(option.disabled&&!(option.selected&&this.is_multiple)){ classes.push("disabled-result"); } if(option.selected){ classes.push("result-selected"); } if(option.group_array_index!=null){ classes.push("group-option"); } if(option.classes!==""){ classes.push(option.classes); } option_el=document.createElement("li"); option_el.className=classes.join(" "); option_el.style.cssText=option.style; option_el.setAttribute("data-option-array-index", option.array_index); option_el.innerHTML=option.search_text; return this.outerHTML(option_el); }; AbstractChosen.prototype.result_add_group=function (group){ var group_el; if(!(group.search_match||group.group_match)){ return ''; } if(!(group.active_options > 0)){ return ''; } group_el=document.createElement("li"); group_el.className="group-result"; group_el.innerHTML=group.search_text; return this.outerHTML(group_el); }; AbstractChosen.prototype.results_update_field=function (){ this.set_default_text(); if(!this.is_multiple){ this.results_reset_cleanup(); } this.result_clear_highlight(); this.results_build(); if(this.results_showing){ return this.winnow_results(); }}; AbstractChosen.prototype.reset_single_select_options=function (){ var result, _i, _len, _ref, _results; _ref=this.results_data; _results=[]; for (_i=0, _len=_ref.length; _i < _len; _i++){ result=_ref[_i]; if(result.selected){ _results.push(result.selected=false); }else{ _results.push(void 0); }} return _results; }; AbstractChosen.prototype.results_toggle=function (){ if(this.results_showing){ return this.results_hide(); }else{ return this.results_show(); }}; AbstractChosen.prototype.results_search=function (evt){ if(this.results_showing){ return this.winnow_results(); }else{ return this.results_show(); }}; AbstractChosen.prototype.winnow_results=function (){ var escapedSearchText, option, regex, regexAnchor, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref; this.no_results_clear(); results=0; searchText=this.get_search_text(); escapedSearchText=searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); regexAnchor=this.search_contains ? "":"^"; regex=new RegExp(regexAnchor + escapedSearchText, 'i'); zregex=new RegExp(escapedSearchText, 'i'); _ref=this.results_data; for (_i=0, _len=_ref.length; _i < _len; _i++){ option=_ref[_i]; option.search_match=false; results_group=null; if(this.include_option_in_results(option)){ if(option.group){ option.group_match=false; option.active_options=0; } if((option.group_array_index!=null)&&this.results_data[option.group_array_index]){ results_group=this.results_data[option.group_array_index]; if(results_group.active_options===0&&results_group.search_match){ results +=1; } results_group.active_options +=1; } if(!(option.group&&!this.group_search)){ option.search_text=option.group ? option.label:option.html; option.search_match=this.search_string_match(option.search_text, regex); if(option.search_match&&!option.group){ results +=1; } if(option.search_match){ if(searchText.length){ startpos=option.search_text.search(zregex); text=option.search_text.substr(0, startpos + searchText.length) + '' + option.search_text.substr(startpos + searchText.length); option.search_text=text.substr(0, startpos) + '' + text.substr(startpos); } if(results_group!=null){ results_group.group_match=true; }}else if((option.group_array_index!=null)&&this.results_data[option.group_array_index].search_match){ option.search_match=true; }} }} this.result_clear_highlight(); if(results < 1&&searchText.length){ this.update_results_content(""); return this.no_results(searchText); }else{ this.update_results_content(this.results_option_build()); return this.winnow_results_set_highlight(); }}; AbstractChosen.prototype.search_string_match=function (search_string, regex){ var part, parts, _i, _len; if(regex.test(search_string)){ return true; }else if(this.enable_split_word_search&&(search_string.indexOf(" ") >=0||search_string.indexOf("[")===0)){ parts=search_string.replace(/\[|\]/g, "").split(" "); if(parts.length){ for (_i=0, _len=parts.length; _i < _len; _i++){ part=parts[_i]; if(regex.test(part)){ return true; }} }} }; AbstractChosen.prototype.choices_count=function (){ var option, _i, _len, _ref; if(this.selected_option_count!=null){ return this.selected_option_count; } this.selected_option_count=0; _ref=this.form_field.options; for (_i=0, _len=_ref.length; _i < _len; _i++){ option=_ref[_i]; if(option.selected){ this.selected_option_count +=1; }} return this.selected_option_count; }; AbstractChosen.prototype.choices_click=function (evt){ evt.preventDefault(); if(!(this.results_showing||this.is_disabled)){ return this.results_show(); }}; AbstractChosen.prototype.keyup_checker=function (evt){ var stroke, _ref; stroke=(_ref=evt.which)!=null ? _ref:evt.keyCode; this.search_field_scale(); switch (stroke){ case 8: if(this.is_multiple&&this.backstroke_length < 1&&this.choices_count() > 0){ return this.keydown_backstroke(); }else if(!this.pending_backstroke){ this.result_clear_highlight(); return this.results_search(); } break; case 13: evt.preventDefault(); if(this.results_showing){ return this.result_select(evt); } break; case 27: if(this.results_showing){ this.results_hide(); } return true; case 9: case 38: case 40: case 16: case 91: case 17: break; default: return this.results_search(); }}; AbstractChosen.prototype.clipboard_event_checker=function (evt){ var _this=this; return setTimeout((function (){ return _this.results_search(); }), 50); }; AbstractChosen.prototype.container_width=function (){ if(this.options.width!=null){ return this.options.width; }else{ return "" + this.form_field.offsetWidth + "px"; }}; AbstractChosen.prototype.include_option_in_results=function (option){ if(this.is_multiple&&(!this.display_selected_options&&option.selected)){ return false; } if(!this.display_disabled_options&&option.disabled){ return false; } if(option.empty){ return false; } return true; }; AbstractChosen.prototype.search_results_touchstart=function (evt){ this.touch_started=true; return this.search_results_mouseover(evt); }; AbstractChosen.prototype.search_results_touchmove=function (evt){ this.touch_started=false; return this.search_results_mouseout(evt); }; AbstractChosen.prototype.search_results_touchend=function (evt){ if(this.touch_started){ return this.search_results_mouseup(evt); }}; AbstractChosen.prototype.outerHTML=function (element){ var tmp; if(element.outerHTML){ return element.outerHTML; } tmp=document.createElement("div"); tmp.appendChild(element); return tmp.innerHTML; }; AbstractChosen.browser_is_supported=function (){ return true; if(window.navigator.appName==="Microsoft Internet Explorer"){ return document.documentMode >=8; } if(/iP(od|hone)/i.test(window.navigator.userAgent)){ return false; } if(/Android/i.test(window.navigator.userAgent)){ if(/Mobile/i.test(window.navigator.userAgent)){ return false; }} return true; }; AbstractChosen.default_multiple_text="Select Some Options"; AbstractChosen.default_single_text="Select an Option"; AbstractChosen.default_no_result_text="No results match"; return AbstractChosen; })(); $=jQuery; $.fn.extend({ chosen: function (options){ if(!AbstractChosen.browser_is_supported()){ return this; } return this.each(function (input_field){ var $this, chosen; $this=$(this); chosen=$this.data('chosen'); if(options==='destroy'&&chosen){ chosen.destroy(); }else if(!chosen){ $this.data('chosen', new Chosen(this, options)); }}); }}); Chosen=(function (_super){ __extends(Chosen, _super); function Chosen(){ _ref=Chosen.__super__.constructor.apply(this, arguments); return _ref; } Chosen.prototype.setup=function (){ this.form_field_jq=$(this.form_field); this.current_selectedIndex=this.form_field.selectedIndex; return this.is_rtl=this.form_field_jq.hasClass("chosen-rtl"); }; Chosen.prototype.set_up_html=function (){ var container_classes, container_props; container_classes=["chosen-container"]; container_classes.push("chosen-container-" + (this.is_multiple ? "multi":"single")); if(this.inherit_select_classes&&this.form_field.className){ container_classes.push(this.form_field.className); } if(this.is_rtl){ container_classes.push("chosen-rtl"); } container_props={ 'class': container_classes.join(' '), 'style': "width: " + (this.container_width()) + ";", 'title': this.form_field.title }; if(this.form_field.id.length){ container_props.id=this.form_field.id.replace(/[^\w]/g, '_') + "_chosen"; } this.container=$("
    ", container_props); if(this.is_multiple){ this.container.html('
      '); }else{ this.container.html('' + this.default_text + '
        '); } this.form_field_jq.hide().after(this.container); this.dropdown=this.container.find('div.chosen-drop').first(); this.search_field=this.container.find('input').first(); this.search_results=this.container.find('ul.chosen-results').first(); this.search_field_scale(); this.search_no_results=this.container.find('li.no-results').first(); if(this.is_multiple){ this.search_choices=this.container.find('ul.chosen-choices').first(); this.search_container=this.container.find('li.search-field').first(); }else{ this.search_container=this.container.find('div.chosen-search').first(); this.selected_item=this.container.find('.chosen-single').first(); } this.results_build(); this.set_tab_index(); this.set_label_behavior(); return this.form_field_jq.trigger("chosen:ready", { chosen: this }); }; Chosen.prototype.register_observers=function (){ var _this=this; this.container.bind('mousedown.chosen', function (evt){ _this.container_mousedown(evt); }); this.container.bind('mouseup.chosen', function (evt){ _this.container_mouseup(evt); }); this.container.bind('mouseenter.chosen', function (evt){ _this.mouse_enter(evt); }); this.container.bind('mouseleave.chosen', function (evt){ _this.mouse_leave(evt); }); this.search_results.bind('mouseup.chosen', function (evt){ _this.search_results_mouseup(evt); }); this.search_results.bind('mouseover.chosen', function (evt){ _this.search_results_mouseover(evt); }); this.search_results.bind('mouseout.chosen', function (evt){ _this.search_results_mouseout(evt); }); this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen', function (evt){ _this.search_results_mousewheel(evt); }); this.search_results.bind('touchstart.chosen', function (evt){ _this.search_results_touchstart(evt); }); this.search_results.bind('touchmove.chosen', function (evt){ _this.search_results_touchmove(evt); }); this.search_results.bind('touchend.chosen', function (evt){ _this.search_results_touchend(evt); }); this.form_field_jq.bind("chosen:updated.chosen", function (evt){ _this.results_update_field(evt); }); this.form_field_jq.bind("chosen:activate.chosen", function (evt){ _this.activate_field(evt); }); this.form_field_jq.bind("chosen:open.chosen", function (evt){ _this.container_mousedown(evt); }); this.form_field_jq.bind("chosen:close.chosen", function (evt){ _this.input_blur(evt); }); this.search_field.bind('blur.chosen', function (evt){ _this.input_blur(evt); }); this.search_field.bind('keyup.chosen', function (evt){ _this.keyup_checker(evt); }); this.search_field.bind('keydown.chosen', function (evt){ _this.keydown_checker(evt); }); this.search_field.bind('focus.chosen', function (evt){ _this.input_focus(evt); }); this.search_field.bind('cut.chosen', function (evt){ _this.clipboard_event_checker(evt); }); this.search_field.bind('paste.chosen', function (evt){ _this.clipboard_event_checker(evt); }); if(this.is_multiple){ return this.search_choices.bind('click.chosen', function (evt){ _this.choices_click(evt); }); }else{ return this.container.bind('click.chosen', function (evt){ evt.preventDefault(); }); }}; Chosen.prototype.destroy=function (){ $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action); if(this.search_field[0].tabIndex){ this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex; } this.container.remove(); this.form_field_jq.removeData('chosen'); return this.form_field_jq.show(); }; Chosen.prototype.search_field_disabled=function (){ this.is_disabled=this.form_field_jq[0].disabled; if(this.is_disabled){ this.container.addClass('chosen-disabled'); this.search_field[0].disabled=true; if(!this.is_multiple){ this.selected_item.unbind("focus.chosen", this.activate_action); } return this.close_field(); }else{ this.container.removeClass('chosen-disabled'); this.search_field[0].disabled=false; if(!this.is_multiple){ return this.selected_item.bind("focus.chosen", this.activate_action); }} }; Chosen.prototype.container_mousedown=function (evt){ if(!this.is_disabled){ if(evt&&evt.type==="mousedown"&&!this.results_showing){ evt.preventDefault(); } if(!((evt!=null)&&($(evt.target)).hasClass("search-choice-close"))){ if(!this.active_field){ if(this.is_multiple){ this.search_field.val(""); } $(this.container[0].ownerDocument).bind('click.chosen', this.click_test_action); this.results_show(); }else if(!this.is_multiple&&evt&&(($(evt.target)[0]===this.selected_item[0])||$(evt.target).parents("a.chosen-single").length)){ evt.preventDefault(); this.results_toggle(); } return this.activate_field(); }} }; Chosen.prototype.container_mouseup=function (evt){ if(evt.target.nodeName==="ABBR"&&!this.is_disabled){ return this.results_reset(evt); }}; Chosen.prototype.search_results_mousewheel=function (evt){ var delta; if(evt.originalEvent){ delta=-evt.originalEvent.wheelDelta||evt.originalEvent.detail; } if(delta!=null){ evt.preventDefault(); if(evt.type==='DOMMouseScroll'){ delta=delta * 40; } return this.search_results.scrollTop(delta + this.search_results.scrollTop()); }}; Chosen.prototype.blur_test=function (evt){ if(!this.active_field&&this.container.hasClass("chosen-container-active")){ return this.close_field(); }}; Chosen.prototype.close_field=function (){ $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action); this.active_field=false; this.results_hide(); this.container.removeClass("chosen-container-active"); this.clear_backstroke(); this.show_search_field_default(); return this.search_field_scale(); }; Chosen.prototype.activate_field=function (){ this.container.addClass("chosen-container-active"); this.active_field=true; this.search_field.val(this.search_field.val()); return this.search_field.focus(); }; Chosen.prototype.test_active_click=function (evt){ var active_container; active_container=$(evt.target).closest('.chosen-container'); if(active_container.length&&this.container[0]===active_container[0]){ return this.active_field=true; }else{ return this.close_field(); }}; Chosen.prototype.results_build=function (){ this.parsing=true; this.selected_option_count=null; this.results_data=SelectParser.select_to_array(this.form_field); if(this.is_multiple){ this.search_choices.find("li.search-choice").remove(); }else if(!this.is_multiple){ this.single_set_selected_text(); if(this.disable_search||this.form_field.options.length <=this.disable_search_threshold){ this.search_field[0].readOnly=true; this.container.addClass("chosen-container-single-nosearch"); }else{ this.search_field[0].readOnly=false; this.container.removeClass("chosen-container-single-nosearch"); }} this.update_results_content(this.results_option_build({ first: true })); this.search_field_disabled(); this.show_search_field_default(); this.search_field_scale(); return this.parsing=false; }; Chosen.prototype.result_do_highlight=function (el){ var high_bottom, high_top, maxHeight, visible_bottom, visible_top; if(el.length){ this.result_clear_highlight(); this.result_highlight=el; this.result_highlight.addClass("highlighted"); maxHeight=parseInt(this.search_results.css("maxHeight"), 10); visible_top=this.search_results.scrollTop(); visible_bottom=maxHeight + visible_top; high_top=this.result_highlight.position().top + this.search_results.scrollTop(); high_bottom=high_top + this.result_highlight.outerHeight(); if(high_bottom >=visible_bottom){ return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight:0); }else if(high_top < visible_top){ return this.search_results.scrollTop(high_top); }} }; Chosen.prototype.result_clear_highlight=function (){ if(this.result_highlight){ this.result_highlight.removeClass("highlighted"); } return this.result_highlight=null; }; Chosen.prototype.results_show=function (){ if(this.is_multiple&&this.max_selected_options <=this.choices_count()){ this.form_field_jq.trigger("chosen:maxselected", { chosen: this }); return false; } this.container.addClass("chosen-with-drop"); this.results_showing=true; this.search_field.focus(); this.search_field.val(this.search_field.val()); this.winnow_results(); return this.form_field_jq.trigger("chosen:showing_dropdown", { chosen: this }); }; Chosen.prototype.update_results_content=function (content){ return this.search_results.html(content); }; Chosen.prototype.results_hide=function (){ if(this.results_showing){ this.result_clear_highlight(); this.container.removeClass("chosen-with-drop"); this.form_field_jq.trigger("chosen:hiding_dropdown", { chosen: this }); } return this.results_showing=false; }; Chosen.prototype.set_tab_index=function (el){ var ti; if(this.form_field.tabIndex){ ti=this.form_field.tabIndex; this.form_field.tabIndex=-1; return this.search_field[0].tabIndex=ti; }}; Chosen.prototype.set_label_behavior=function (){ var _this=this; this.form_field_label=this.form_field_jq.parents("label"); if(!this.form_field_label.length&&this.form_field.id.length){ this.form_field_label=$("label[for='" + this.form_field.id + "']"); } if(this.form_field_label.length > 0){ return this.form_field_label.bind('click.chosen', function (evt){ if(_this.is_multiple){ return _this.container_mousedown(evt); }else{ return _this.activate_field(); }}); }}; Chosen.prototype.show_search_field_default=function (){ if(this.is_multiple&&this.choices_count() < 1&&!this.active_field){ this.search_field.val(this.default_text); return this.search_field.addClass("default"); }else{ this.search_field.val(""); return this.search_field.removeClass("default"); }}; Chosen.prototype.search_results_mouseup=function (evt){ var target; target=$(evt.target).hasClass("active-result") ? $(evt.target):$(evt.target).parents(".active-result").first(); if(target.length){ this.result_highlight=target; this.result_select(evt); return this.search_field.focus(); }}; Chosen.prototype.search_results_mouseover=function (evt){ var target; target=$(evt.target).hasClass("active-result") ? $(evt.target):$(evt.target).parents(".active-result").first(); if(target){ return this.result_do_highlight(target); }}; Chosen.prototype.search_results_mouseout=function (evt){ if($(evt.target).hasClass("active-result"||$(evt.target).parents('.active-result').first())){ return this.result_clear_highlight(); }}; Chosen.prototype.choice_build=function (item){ var choice, close_link, _this=this; choice=$('
      • ', { "class": "search-choice" }).html("" + item.html + ""); if(item.disabled){ choice.addClass('search-choice-disabled'); }else{ close_link=$('', { "class": 'search-choice-close', 'data-option-array-index': item.array_index }); close_link.bind('click.chosen', function (evt){ return _this.choice_destroy_link_click(evt); }); choice.append(close_link); } return this.search_container.before(choice); }; Chosen.prototype.choice_destroy_link_click=function (evt){ evt.preventDefault(); evt.stopPropagation(); if(!this.is_disabled){ return this.choice_destroy($(evt.target)); }}; Chosen.prototype.choice_destroy=function (link){ if(this.result_deselect(link[0].getAttribute("data-option-array-index"))){ this.show_search_field_default(); if(this.is_multiple&&this.choices_count() > 0&&this.search_field.val().length < 1){ this.results_hide(); } link.parents('li').first().remove(); return this.search_field_scale(); }}; Chosen.prototype.results_reset=function (){ this.reset_single_select_options(); this.form_field.options[0].selected=true; this.single_set_selected_text(); this.show_search_field_default(); this.results_reset_cleanup(); this.form_field_jq.trigger("change"); if(this.active_field){ return this.results_hide(); }}; Chosen.prototype.results_reset_cleanup=function (){ this.current_selectedIndex=this.form_field.selectedIndex; return this.selected_item.find("abbr").remove(); }; Chosen.prototype.result_select=function (evt){ var high, item; if(this.result_highlight){ high=this.result_highlight; this.result_clear_highlight(); if(this.is_multiple&&this.max_selected_options <=this.choices_count()){ this.form_field_jq.trigger("chosen:maxselected", { chosen: this }); return false; } if(this.is_multiple){ high.removeClass("active-result"); }else{ this.reset_single_select_options(); } item=this.results_data[high[0].getAttribute("data-option-array-index")]; item.selected=true; this.form_field.options[item.options_index].selected=true; this.selected_option_count=null; if(this.is_multiple){ this.choice_build(item); }else{ this.single_set_selected_text(item.text); } if(!((evt.metaKey||evt.ctrlKey)&&this.is_multiple)){ this.results_hide(); } this.search_field.val(""); if(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex){ this.form_field_jq.trigger("change", { 'selected': this.form_field.options[item.options_index].value }); } this.current_selectedIndex=this.form_field.selectedIndex; evt.preventDefault(); evt.stopPropagation(); return this.search_field_scale(); }}; Chosen.prototype.single_set_selected_text=function (text){ if(text==null){ text=this.default_text; } if(text===this.default_text){ this.selected_item.addClass("chosen-default"); }else{ this.single_deselect_control_build(); this.selected_item.removeClass("chosen-default"); } return this.selected_item.find("span").text(text); }; Chosen.prototype.result_deselect=function (pos){ var result_data; result_data=this.results_data[pos]; if(!this.form_field.options[result_data.options_index].disabled){ result_data.selected=false; this.form_field.options[result_data.options_index].selected=false; this.selected_option_count=null; this.result_clear_highlight(); if(this.results_showing){ this.winnow_results(); } this.form_field_jq.trigger("change", { deselected: this.form_field.options[result_data.options_index].value }); this.search_field_scale(); return true; }else{ return false; }}; Chosen.prototype.single_deselect_control_build=function (){ if(!this.allow_single_deselect){ return; } if(!this.selected_item.find("abbr").length){ this.selected_item.find("span").first().after(""); } return this.selected_item.addClass("chosen-single-with-deselect"); }; Chosen.prototype.get_search_text=function (){ if(this.search_field.val()===this.default_text){ return ""; }else{ return $('
        ').text($.trim(this.search_field.val())).html(); }}; Chosen.prototype.winnow_results_set_highlight=function (){ var do_high, selected_results; selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result"):[]; do_high=selected_results.length ? selected_results.first():this.search_results.find(".active-result").first(); if(do_high!=null){ return this.result_do_highlight(do_high); }}; Chosen.prototype.no_results=function (terms){ var no_results_html; no_results_html=$('
      • ' + this.results_none_found + ' ""
      • '); no_results_html.find("span").first().html(terms); this.search_results.append(no_results_html); return this.form_field_jq.trigger("chosen:no_results", { chosen: this }); }; Chosen.prototype.no_results_clear=function (){ return this.search_results.find(".no-results").remove(); }; Chosen.prototype.keydown_arrow=function (){ var next_sib; if(this.results_showing&&this.result_highlight){ next_sib=this.result_highlight.nextAll("li.active-result").first(); if(next_sib){ return this.result_do_highlight(next_sib); }}else{ return this.results_show(); }}; Chosen.prototype.keyup_arrow=function (){ var prev_sibs; if(!this.results_showing&&!this.is_multiple){ return this.results_show(); }else if(this.result_highlight){ prev_sibs=this.result_highlight.prevAll("li.active-result"); if(prev_sibs.length){ return this.result_do_highlight(prev_sibs.first()); }else{ if(this.choices_count() > 0){ this.results_hide(); } return this.result_clear_highlight(); }} }; Chosen.prototype.keydown_backstroke=function (){ var next_available_destroy; if(this.pending_backstroke){ this.choice_destroy(this.pending_backstroke.find("a").first()); return this.clear_backstroke(); }else{ next_available_destroy=this.search_container.siblings("li.search-choice").last(); if(next_available_destroy.length&&!next_available_destroy.hasClass("search-choice-disabled")){ this.pending_backstroke=next_available_destroy; if(this.single_backstroke_delete){ return this.keydown_backstroke(); }else{ return this.pending_backstroke.addClass("search-choice-focus"); }} }}; Chosen.prototype.clear_backstroke=function (){ if(this.pending_backstroke){ this.pending_backstroke.removeClass("search-choice-focus"); } return this.pending_backstroke=null; }; Chosen.prototype.keydown_checker=function (evt){ var stroke, _ref1; stroke=(_ref1=evt.which)!=null ? _ref1:evt.keyCode; this.search_field_scale(); if(stroke!==8&&this.pending_backstroke){ this.clear_backstroke(); } switch (stroke){ case 8: this.backstroke_length=this.search_field.val().length; break; case 9: if(this.results_showing&&!this.is_multiple){ this.result_select(evt); } this.mouse_on_container=false; break; case 13: evt.preventDefault(); break; case 38: evt.preventDefault(); this.keyup_arrow(); break; case 40: evt.preventDefault(); this.keydown_arrow(); break; }}; Chosen.prototype.search_field_scale=function (){ var div, f_width, h, style, style_block, styles, w, _i, _len; if(this.is_multiple){ h=0; w=0; style_block="position:absolute; left: -1000px; top: -1000px; display:none;"; styles=['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing']; for (_i=0, _len=styles.length; _i < _len; _i++){ style=styles[_i]; style_block +=style + ":" + this.search_field.css(style) + ";"; } div=$('
        ', { 'style': style_block }); div.text(this.search_field.val()); $('body').append(div); w=div.width() + 25; div.remove(); f_width=this.container.outerWidth(); if(w > f_width - 10){ w=f_width - 10; } return this.search_field.css({ 'width': w + 'px' }); }}; return Chosen; })(AbstractChosen); }).call(this); var woof_edit_view=false; var woof_current_conatiner_class=''; var woof_current_containers_data={}; jQuery(function (){ jQuery('.woof_edit_view').click(function (){ woof_edit_view=true; var sid=jQuery(this).data('sid'); var sid_tmp=sid.substring(0, sid.indexOf(' ')); if(sid_tmp){ sid=sid_tmp; } var css_class='woof_sid_' + sid; jQuery(this).next('div').html(css_class); jQuery("." + css_class + " .woof_container_overlay_item").show(); jQuery("." + css_class + " .woof_container").addClass('woof_container_overlay'); jQuery.each(jQuery("." + css_class + " .woof_container_overlay_item"), function (index, ul){ jQuery(this).html(jQuery(this).parents('.woof_container').data('css-class')); }); return false; }); woof_init_masonry(); }); function woof_init_masonry(){ return; }; (function(){function r(){}var n=this,t=n._,e=Array.prototype,o=Object.prototype,u=Function.prototype,i=e.push,c=e.slice,s=o.toString,a=o.hasOwnProperty,f=Array.isArray,l=Object.keys,p=u.bind,h=Object.create,v=function(n){return n instanceof v?n:this instanceof v?void(this._wrapped=n):new v(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=v),exports._=v):n._=v,v.VERSION="1.8.3";var y=function(u,i,n){if(void 0===i)return u;switch(null==n?3:n){case 1:return function(n){return u.call(i,n)};case 2:return function(n,t){return u.call(i,n,t)};case 3:return function(n,t,r){return u.call(i,n,t,r)};case 4:return function(n,t,r,e){return u.call(i,n,t,r,e)}}return function(){return u.apply(i,arguments)}},d=function(n,t,r){return null==n?v.identity:v.isFunction(n)?y(n,t,r):v.isObject(n)?v.matcher(n):v.property(n)};v.iteratee=function(n,t){return d(n,t,1/0)};function g(c,f){return function(n){var t=arguments.length;if(t<2||null==n)return n;for(var r=1;r":">",'"':""","'":"'","`":"`"},R=v.invert(T);v.escape=B(T),v.unescape=B(R),v.result=function(n,t,r){var e=null==n?void 0:n[t];return void 0===e&&(e=r),v.isFunction(e)?e.call(n):e};var q=0;v.uniqueId=function(n){var t=++q+"";return n?n+t:t},v.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};function K(n){return"\\"+D[n]}var z=/(.)^/,D={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},L=/\\|'|\r|\n|\u2028|\u2029/g;v.template=function(i,n,t){!n&&t&&(n=t),n=v.defaults({},n,v.templateSettings);var r=RegExp([(n.escape||z).source,(n.interpolate||z).source,(n.evaluate||z).source].join("|")+"|$","g"),o=0,a="__p+='";i.replace(r,function(n,t,r,e,u){return a+=i.slice(o,u).replace(L,K),o=u+n.length,t?a+="'+\n((__t=("+t+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":e&&(a+="';\n"+e+"\n__p+='"),n}),a+="';\n",n.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{var e=new Function(n.variable||"obj","_",a)}catch(n){throw n.source=a,n}function u(n){return e.call(this,n,v)}var c=n.variable||"obj";return u.source="function("+c+"){\n"+a+"}",u},v.chain=function(n){var t=v(n);return t._chain=!0,t};function P(n,t){return n._chain?v(t).chain():t}v.mixin=function(r){v.each(v.functions(r),function(n){var t=v[n]=r[n];v.prototype[n]=function(){var n=[this._wrapped];return i.apply(n,arguments),P(this,t.apply(v,n))}})},v.mixin(v),v.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var r=e[t];v.prototype[t]=function(){var n=this._wrapped;return r.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],P(this,n)}}),v.each(["concat","join","slice"],function(n){var t=e[n];v.prototype[n]=function(){return P(this,t.apply(this._wrapped,arguments))}}),v.prototype.value=function(){return this._wrapped},v.prototype.valueOf=v.prototype.toJSON=v.prototype.value,v.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return v})}).call(this); window.wp=window.wp||{},function(i){var e="undefined"==typeof _wpUtilSettings?{}:_wpUtilSettings;wp.template=_.memoize(function(t){var n,s={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(e){return(n=n||_.template(i("#tmpl-"+t).html(),s))(e)}}),wp.ajax={settings:e.ajax||{},post:function(e,t){return wp.ajax.send({data:_.isObject(e)?e:_.extend(t||{},{action:e})})},send:function(e,n){var t,s;return _.isObject(e)?n=e:(n=n||{}).data=_.extend(n.data||{},{action:e}),n=_.defaults(n||{},{type:"POST",url:wp.ajax.settings.url,context:this}),(t=(s=i.Deferred(function(t){n.success&&t.done(n.success),n.error&&t.fail(n.error),delete n.success,delete n.error,t.jqXHR=i.ajax(n).done(function(e){"1"!==e&&1!==e||(e={success:!0}),_.isObject(e)&&!_.isUndefined(e.success)?t[e.success?"resolveWith":"rejectWith"](this,[e.data]):t.rejectWith(this,[e])}).fail(function(){t.rejectWith(this,arguments)})})).promise()).abort=function(){return s.jqXHR.abort(),this},t}}}(jQuery); !function(y,c,i,n){var t=function(t){var a=this;a.$form=t,a.$attributeFields=t.find(".variations select"),a.$singleVariation=t.find(".single_variation"),a.$singleVariationWrap=t.find(".single_variation_wrap"),a.$resetVariations=t.find(".reset_variations"),a.$product=t.closest(".product"),a.variationData=t.data("product_variations"),a.useAjax=!1===a.variationData,a.xhr=!1,a.loading=!0,a.$singleVariationWrap.show(),a.$form.off(".wc-variation-form"),a.getChosenAttributes=a.getChosenAttributes.bind(a),a.findMatchingVariations=a.findMatchingVariations.bind(a),a.isMatch=a.isMatch.bind(a),a.toggleResetLink=a.toggleResetLink.bind(a),t.on("click.wc-variation-form",".reset_variations",{variationForm:a},a.onReset),t.on("reload_product_variations",{variationForm:a},a.onReload),t.on("hide_variation",{variationForm:a},a.onHide),t.on("show_variation",{variationForm:a},a.onShow),t.on("click",".single_add_to_cart_button",{variationForm:a},a.onAddToCart),t.on("reset_data",{variationForm:a},a.onResetDisplayedVariation),t.on("reset_image",{variationForm:a},a.onResetImage),t.on("change.wc-variation-form",".variations select",{variationForm:a},a.onChange),t.on("found_variation.wc-variation-form",{variationForm:a},a.onFoundVariation),t.on("check_variations.wc-variation-form",{variationForm:a},a.onFindVariation),t.on("update_variation_values.wc-variation-form",{variationForm:a},a.onUpdateAttributes),setTimeout(function(){t.trigger("check_variations"),t.trigger("wc_variation_form",a),a.loading=!1},100)};t.prototype.onReset=function(t){t.preventDefault(),t.data.variationForm.$attributeFields.val("").change(),t.data.variationForm.$form.trigger("reset_data")},t.prototype.onReload=function(t){t=t.data.variationForm;t.variationData=t.$form.data("product_variations"),t.useAjax=!1===t.variationData,t.$form.trigger("check_variations")},t.prototype.onHide=function(t){t.preventDefault(),t.data.variationForm.$form.find(".single_add_to_cart_button").removeClass("wc-variation-is-unavailable").addClass("disabled wc-variation-selection-needed"),t.data.variationForm.$form.find(".woocommerce-variation-add-to-cart").removeClass("woocommerce-variation-add-to-cart-enabled").addClass("woocommerce-variation-add-to-cart-disabled")},t.prototype.onShow=function(t,a,i){t.preventDefault(),i?(t.data.variationForm.$form.find(".single_add_to_cart_button").removeClass("disabled wc-variation-selection-needed wc-variation-is-unavailable"),t.data.variationForm.$form.find(".woocommerce-variation-add-to-cart").removeClass("woocommerce-variation-add-to-cart-disabled").addClass("woocommerce-variation-add-to-cart-enabled")):(t.data.variationForm.$form.find(".single_add_to_cart_button").removeClass("wc-variation-selection-needed").addClass("disabled wc-variation-is-unavailable"),t.data.variationForm.$form.find(".woocommerce-variation-add-to-cart").removeClass("woocommerce-variation-add-to-cart-enabled").addClass("woocommerce-variation-add-to-cart-disabled")),wp.mediaelement&&t.data.variationForm.$form.find(".wp-audio-shortcode, .wp-video-shortcode").not(".mejs-container").filter(function(){return!y(this).parent().hasClass("mejs-mediaelement")}).mediaelementplayer(wp.mediaelement.settings)},t.prototype.onAddToCart=function(t){y(this).is(".disabled")&&(t.preventDefault(),y(this).is(".wc-variation-is-unavailable")?c.alert(wc_add_to_cart_variation_params.i18n_unavailable_text):y(this).is(".wc-variation-selection-needed")&&c.alert(wc_add_to_cart_variation_params.i18n_make_a_selection_text))},t.prototype.onResetDisplayedVariation=function(t){t=t.data.variationForm;t.$product.find(".product_meta").find(".sku").wc_reset_content(),t.$product.find(".product_weight, .woocommerce-product-attributes-item--weight .woocommerce-product-attributes-item__value").wc_reset_content(),t.$product.find(".product_dimensions, .woocommerce-product-attributes-item--dimensions .woocommerce-product-attributes-item__value").wc_reset_content(),t.$form.trigger("reset_image"),t.$singleVariation.slideUp(200).trigger("hide_variation")},t.prototype.onResetImage=function(t){t.data.variationForm.$form.wc_variations_image_update(!1)},t.prototype.onFindVariation=function(t,a){var i=t.data.variationForm,e=void 0!==a?a:i.getChosenAttributes(),a=e.data;e.count&&e.count===e.chosenCount?i.useAjax?(i.xhr&&i.xhr.abort(),i.$form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),a.product_id=parseInt(i.$form.data("product_id"),10),a.custom_data=i.$form.data("custom_data"),i.xhr=y.ajax({url:wc_add_to_cart_variation_params.wc_ajax_url.toString().replace("%%endpoint%%","get_variation"),type:"POST",data:a,success:function(t){t?i.$form.trigger("found_variation",[t]):(i.$form.trigger("reset_data"),e.chosenCount=0,i.loading||(i.$form.find(".single_variation").after('

        '+wc_add_to_cart_variation_params.i18n_no_matching_variations_text+"

        "),i.$form.find(".wc-no-matching-variations").slideDown(200)))},complete:function(){i.$form.unblock()}})):(i.$form.trigger("update_variation_values"),(a=i.findMatchingVariations(i.variationData,a).shift())?i.$form.trigger("found_variation",[a]):(i.$form.trigger("reset_data"),e.chosenCount=0,i.loading||(i.$form.find(".single_variation").after('

        '+wc_add_to_cart_variation_params.i18n_no_matching_variations_text+"

        "),i.$form.find(".wc-no-matching-variations").slideDown(200)))):(i.$form.trigger("update_variation_values"),i.$form.trigger("reset_data")),i.toggleResetLink(0parseFloat(a.max_qty)?a.max_qty:t)"),s=i.val()||"",c=!0;i.data("attribute_html")||((_=i.clone()).find("option").removeAttr("disabled attached").removeAttr("selected"),i.data("attribute_options",_.find("option"+o).get()),i.data("attribute_html",_.html())),n.html(i.data("attribute_html"));var _=y.extend(!0,{},$);_[e]="";var d,m=b.findMatchingVariations(b.variationData,_);for(d in m)if("undefined"!=typeof m[d]){var l,v=m[d].attributes;for(l in v)if(v.hasOwnProperty(l)){var g=v[l],u="";if(l===e)if(m[d].variation_is_active&&(u="enabled"),g){g=y("
        ").html(g).text();var f=n.find("option");if(f.length)for(var h=0,p=f.length;h=Gt()-1&&i<0)&&(e=wt.x+i*y.mainScrollEndFriction)}wt.x=e,nt(e,W)}function u(e,t){var n=bt[e]-Xe[e];return Ye[e]+He[e]+n-t/q*n}function g(e,t){e.x=t.x,e.y=t.y,t.id&&(e.id=t.id)}function m(e){e.x=Math.round(e.x),e.y=Math.round(e.y)}function w(e,t){var n=$t(h.currItem,Be,e);return t&&(Re=n),n}function b(e){return e||(e=h.currItem),e.initialZoomLevel}function I(e){return e||(e=h.currItem),0t.min[e]?(n[e]=t.min[e],!0):n[e]Re.min[e]||rRe.min[e]&&(n=y.panEndFriction,Re.min[e],i=Re.min[e]-Ye[e]),(i<=0||u<0)&&1ft.x&&(a=ft.x)):Re.min.x!==Re.max.x&&(o=r)):(rh.currItem.fitRatio&&(We[e]+=t[e]*n)}function L(e){if(!("mousedown"===e.type&&0h.currItem.fitRatio&&Rt(ge):Ft())}}var N,U,H,Y,W,B,G,X,V,K,q,$,j,J,Q,ee,te,ne,ie,oe,ae,re,le,se,ue,ce,de,me,pe,fe,he,ye,xe,ve,ge,we,be,Ie,Ce,De,Te,Me,Se,Ae,Ee,Oe,ke,Re,Pe,Ze,Fe,Le,ze,_e,Ne,Ue,He={x:0,y:0},Ye={x:0,y:0},We={x:0,y:0},Be={},Ge=0,Xe={},Ve={x:0,y:0},Ke=0,qe=!0,$e=[],je={},Je=!1,Qe={},et=function(e){Pe&&(e&&(K>h.currItem.fitRatio?Je||(jt(h.currItem,!1,!0),Je=!0):Je&&(jt(h.currItem),Je=!1)),o(Pe,We.x,We.y,K))},tt=function(e){e.container&&o(e.container.style,e.initialPosition.x,e.initialPosition.y,e.initialZoomLevel,e)},nt=function(e,t){t[re]=$+e+"px, 0px"+j},it=null,ot=function(){it&&(f.unbind(document,"mousemove",ot),f.addClass(p,"pswp--has_mouse"),y.mouseUsed=!0,x("mouseUsed")),it=setTimeout(function(){it=null},100)},at={},rt=0,lt={shout:x,listen:a,viewportSize:Be,options:y,isMainScrollAnimating:function(){return Ze},getZoomLevel:function(){return K},getCurrentIndex:function(){return Y},isDragging:function(){return Ce},isZooming:function(){return Oe},setScrollOffset:function(e,t){Xe.x=e,fe=Xe.y=t,x("updateScrollOffset",Xe)},applyZoomPan:function(e,t,n,i){We.x=t,We.y=n,K=e,et(i)},init:function(){if(!N&&!U){var e;h.framework=f,h.template=p,h.bg=f.getChildByClass(p,"pswp__bg"),de=p.className,N=!0,he=f.detectFeatures(),ue=he.raf,ce=he.caf,re=he.transform,pe=he.oldIE,h.scrollWrap=f.getChildByClass(p,"pswp__scroll-wrap"),h.container=f.getChildByClass(h.scrollWrap,"pswp__container"),W=h.container.style,h.itemHolders=ee=[{el:h.container.children[0],wrap:0,index:-1},{el:h.container.children[1],wrap:0,index:-1},{el:h.container.children[2],wrap:0,index:-1}],ee[0].el.style.display=ee[2].el.style.display="none",function(){if(re){var e=he.perspective&&!se;return $="translate"+(e?"3d(":"("),j=he.perspective?", 0px)":")"}re="left",f.addClass(p,"pswp--ie"),nt=function(e,t){t.left=e+"px"},tt=function(e){var t=1=Gt())&&(Y=0),h.currItem=Bt(Y),(he.isOldIOSPhone||he.isOldAndroid)&&(qe=!1),p.setAttribute("aria-hidden","false"),y.modal&&(qe?p.style.position="fixed":(p.style.position="absolute",p.style.top=f.getScrollY()+"px")),fe===undefined&&(x("initialLayout"),fe=me=f.getScrollY());var n="pswp--open ";for(y.mainClass&&(n+=y.mainClass+" "),y.showHideOpacity&&(n+="pswp--animate_opacity "),n+=se?"pswp--touch":"pswp--notouch",n+=he.animationName?" pswp--css_animation":"",n+=he.svg?" pswp--svg":"",f.addClass(p,n),h.updateSize(),B=-1,Ke=null,e=0;e<3;e++)nt((e+B)*Ve.x,ee[e].el.style);pe||f.bind(h.scrollWrap,X,h),a("initialZoomInEnd",function(){h.setContent(ee[0],Y-1),h.setContent(ee[2],Y+1),ee[0].el.style.display=ee[2].el.style.display="block",y.focus&&p.focus(),f.bind(document,"keydown",h),he.transform&&f.bind(h.scrollWrap,"click",h),y.mouseUsed||f.bind(document,"mousemove",ot),f.bind(window,"resize scroll orientationchange",h),x("bindEvents")}),h.setContent(ee[1],Y),h.updateCurrItem(),x("afterInit"),qe||(J=setInterval(function(){rt||Ce||Oe||K!==h.currItem.initialZoomLevel||h.updateSize()},1e3)),f.addClass(p,"pswp--visible")}},close:function(){N&&(U=!(N=!1),x("close"),f.unbind(window,"resize scroll orientationchange",h),f.unbind(window,"scroll",V.scroll),f.unbind(document,"keydown",h),f.unbind(document,"mousemove",ot),he.transform&&f.unbind(h.scrollWrap,"click",h),Ce&&f.unbind(window,G,h),clearTimeout(ye),x("unbindEvents"),Xt(h.currItem,null,!0,h.destroy))},destroy:function(){x("destroy"),Ut&&clearTimeout(Ut),p.setAttribute("aria-hidden","true"),p.className=de,J&&clearInterval(J),f.unbind(h.scrollWrap,X,h),f.unbind(window,"scroll",h),Ct(),S(),Qe=null},panTo:function(e,t,n){n||(e>Re.min.x?e=Re.min.x:eRe.min.y?t=Re.min.y:th.currItem.initialZoomLevel+h.currItem.initialZoomLevel/15&&(Ne=!0);var i=1,o=b(),a=I();if(nRe.min[t]?i.backAnimDestination[t]=Re.min[t]:We[t]=Gt()&&(Y=y.loop?0:Gt()-1,o=!0),o&&!y.loop||(Ke+=i,Ge-=i,n=!0));var l,s=Ve.x*Ge,u=Math.abs(s-wt.x);return l=n||s>wt.x==0The image could not be loaded.
        ',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return Ht.length}},$t=function(e,t,n){if(!e.src||e.loadError)return e.w=e.h=0,e.initialZoomLevel=e.fitRatio=1,e.bounds={center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}},e.initialPosition=e.bounds.center,e.bounds;var i=!n;if(i&&(e.vGap||(e.vGap={top:0,bottom:0}),x("parseVerticalMargin",e)),Vt.x=t.x,Vt.y=t.y-e.vGap.top-e.vGap.bottom,i){var o=Vt.x/e.w,a=Vt.y/e.h;e.fitRatio=oVt.x?Math.round(Vt.x-t):i.center.x,i.max.y=n>Vt.y?Math.round(Vt.y-n)+e.vGap.top:i.center.y,i.min.x=t>Vt.x?0:i.center.x,i.min.y=n>Vt.y?e.vGap.top:i.center.y}(e,e.w*n,e.h*n),i&&n===e.initialZoomLevel&&(e.initialPosition=e.bounds.center),e.bounds):void 0},jt=function(e,t,n){if(e.src){t||(t=e.container.lastChild);var i=n?e.w:Math.round(e.w*e.fitRatio),o=n?e.h:Math.round(e.h*e.fitRatio);e.placeholder&&!e.loaded&&(e.placeholder.style.width=i+"px",e.placeholder.style.height=o+"px"),t.style.width=i+"px",t.style.height=o+"px"}};n("Controller",{publicMethods:{lazyLoadItem:function(e){e=s(e);var t=Bt(e);t&&(!t.loaded&&!t.loading||Q)&&(x("gettingData",e,t),t.src&&zt(t))},initController:function(){f.extend(y,qt,!0),h.items=Ht=e,Bt=h.getItemAt,Gt=y.getNumItemsFn,y.loop,Gt()<3&&(y.loop=!1),a("beforeChange",function(e){var t,n=y.preload,i=null===e||0<=e,o=Math.min(n[0],Gt()),a=Math.min(n[1],Gt());for(t=1;t<=(i?a:o);t++)h.lazyLoadItem(Y+t);for(t=1;t<=(i?o:a);t++)h.lazyLoadItem(Y-t)}),a("initialLayout",function(){h.currItem.initialLayout=y.getThumbBoundsFn&&y.getThumbBoundsFn(Y)}),a("mainScrollAnimComplete",Nt),a("initialZoomInEnd",Nt),a("destroy",function(){for(var e,t=0;t=Re.max.x&&n<=Re.min.y&&n>=Re.max.y)&&e.preventDefault(),h.panTo(t,n)},toggleDesktopZoom:function(e){e=e||{x:Be.x/2+Xe.x,y:Be.y/2+Xe.y};var t=y.getDoubleTapZoom(!0,h.currItem),n=K===t;h.mouseZoomedIn=!n,h.zoomTo(n?h.currItem.initialZoomLevel:t,e,333),f[(n?"remove":"add")+"Class"](p,"pswp--zoomed-in")}}});function nn(){return yn.hash.substring(1)}function on(){rn&&clearTimeout(rn),sn&&clearTimeout(sn)}function an(){var e=nn(),t={};if(e.length<5)return t;var n,i=e.split("&");for(n=0;n-1&&(c.onTap(),d=!0);if(d){a.stopPropagation&&a.stopPropagation(),r=!0;var h=b.features.isOldAndroid?600:30;s=setTimeout(function(){r=!1},h)}},B=function(){return!a.likelyTouchDevice||q.mouseUsed||screen.width>q.fitControlsWidth},C=function(a,c,d){b[(d?"add":"remove")+"Class"](a,"pswp__"+c)},D=function(){var a=1===q.getNumItemsFn();a!==p&&(C(d,"ui--one-slide",a),p=a)},E=function(){C(i,"share-modal--hidden",y)},F=function(){return y=!y,y?(b.removeClass(i,"pswp__share-modal--fade-in"),setTimeout(function(){y&&E()},300)):(E(),setTimeout(function(){y||b.addClass(i,"pswp__share-modal--fade-in")},30)),y||H(),!1},G=function(b){b=b||window.event;var c=b.target||b.srcElement;return a.shout("shareLinkClick",b,c),!!c.href&&(!!c.hasAttribute("download")||(window.open(c.href,"pswp_share","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left="+(window.screen?Math.round(screen.width/2-275):100)),y||F(),!1))},H=function(){for(var a,b,c,d,e,f="",g=0;g